This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-22
Channels
- # beginners (143)
- # boot (18)
- # chestnut (5)
- # clara (1)
- # cljs-experience (1)
- # cljsrn (13)
- # clojure (290)
- # clojure-austin (4)
- # clojure-italy (13)
- # clojure-nl (21)
- # clojure-russia (14)
- # clojure-spec (49)
- # clojure-uk (59)
- # clojurebridge (7)
- # clojurescript (54)
- # core-logic (2)
- # cursive (22)
- # datomic (149)
- # fulcro (31)
- # graphql (14)
- # hoplon (59)
- # keechma (24)
- # lambdaisland (1)
- # lumo (86)
- # off-topic (3)
- # om (19)
- # om-next (1)
- # onyx (4)
- # portkey (20)
- # re-frame (41)
- # reagent (63)
- # ring (1)
- # ring-swagger (1)
- # spacemacs (9)
- # sql (10)
- # yada (13)
I wish there was a "transactor library" as well as a peer library, as an alternative to shipping code as strings to the transactor
a library where you spawn the transactor server yourself, and there's hooks for processing transactions and registering transaction functions
so you can redeploy your transactor service, rather than shipping strings and running code in a "foreign" place
@hmaurer - it’s a bit more involved than that 🙂 I know I could do it on the peer, hence my 2nd solution. I’d really like to avoid it though.
@augustl cognitect's advice is to add a jar to the transactor classpath with your code. Then the tx fn impl just calls something from that jar
The problem with these approaches is that it doesn't version code in the same timeline as data
are there any practical problems with not having the transaction functions in the database, versioning/history/timeline wise?
:cause :db.error/wrong-type-for-attribute Value https://some-url.com is not a valid :uri for attribute :person/photo
@raymcdermott (java.net.URI. "
@raymcdermott ah; #uuid
is a reader macro which creates an instance of java.util.UUID
=> (type #uuid "6c84fb90-12c4-11e1-840d-7b25c5ee775a")
#<Class@6a2f6f80 java.util.UUID>
Hey all, I’m running into an odd problem. On my docker container I’m unable to pull datomic-pro yet locally I am. I have set teh following:
:repositories [["" {:url ""
:username [:env/datomic_username]
:password [:env/datomic_password]}]]
and have those environment variables set in the docker container@raymcdermott ah if it’s in an EDN file it’s easy
except i use this format:
:repositories {"" {:url ""
:username [:gpg :env/datomic_repo_user]
:password [:gpg :env/datomic_repo_pass]}
Could not transfer artifact com.datomic:datomic-pro:pom:0.9.5407 from/to
gpg --default-recipient-self -e ~/.lein/credentials.clj > ~/.lein/credentials.clj.gpg
So you did this <- and just copied that to the ci?
@hmaurer I’ll give it a shot, though TBH I find it irksome that the supported data types don’t have reader literals
@raymcdermott these are Datomic’s supported data types. I am not sure why uuid has a reader macro in clojure and URI does not, but you can’t have a reader literal for every type anyway
b/c java.net.URI is a disaster
Don't be so harsh, it's not that big an issue to have to do a network call for each equality check. Oh wait, it actually is!
Errrr I thought that particularly design affliction affected java.net.URL
, not java.net.URI
…
@U06GS6P1N wait what?!
@U04V4HWQ4 oh yeah my mistake. Apologies to java.net.URI
🙂
oh yeah, I was thinking of URL (although URI is no picnic either)
java.net.URI
is a data structure dressed up as a class without providing any of the ostensible benefits of a class
Aside from some minor deviations noted below, an instance of this class represents a URI reference as defined by RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax, amended by RFC 2732: Format for Literal IPv6 Addresses in URLs. The Literal IPv6 address format also supports scope_ids. The syntax and usage of scope_ids is described here. This class provides constructors for creating URI instances from their components or by parsing their string forms, methods for accessing the various components of an instance, and methods for normalizing, resolving, and relativizing URI instances. Instances of this class are immutable.
you can always validate with URI, then store in a string (or a map in pieces)
sorry, I walked into this in the middle and carefully avoided all important context
I thought the question was why clojure didn’t have a #uri literal. if you’re using Datomic, then go for it.
does datomic have a #uri reader? I don’t remember.
yeah, my comments were really about URL, so I’ve managed to create maximal confusion
if I say #uri “https://some-valid-uri” it barfs
if you want to represent uris which will end up in Datomic in edn, then I think creating your own reader literal for them is a reasonably sane thing to do (but I would call them #ray/uri or something namespaced so you don’t collide when some future Clojure version includes them in core)
if only it was possible to package useful code in a way that more than one person could use it
i wouldn’t use the uri datatype @raymcdermott
not sure what using it gets you other than pain 🙂
but I will explain why types are sometimes useful if you insist @robert-stuttaford 😉
@petr there are several ways to do it, but updating the cloudformation stack through the aws console is probably the easiest http://docs.datomic.com/aws.html#aws-management-console
@stijn I was thinking more in terms of updating the version/cw metrics. Basically the stuff set in the config files
CompilerException java.lang.RuntimeException: No reader function for tag db/id, compiling:(core.clj:141:25)
@raymcdermott how are you reading your edn file?
I am not too sure how the Datomic library defines the EDN tag literals, so I can’t advise you on how to merge your custom ones. Someone more knowledgeable might be able to answer 🙂
so maybe @robert-stuttaford is right … pure pain … what do you think @alexmiller?
well, you can either set up an external data_readers.clj in your project (it should be merged with all others found on the classpath) OR you can explicit bind your own around the reader call
binding *data-readers*
that is
(doc *data-readers*)
is a good place to start
this and all the related things around it is an area ripe for a guide
I guess I did write some stuff about it at https://clojure.org/reference/reader#tagged_literals
but could use some more exposition and examples
if i’m using lein - what’s the least painful way to get my code on the classpath in a way that datomic db.fn :requires can find it?