Fork me on GitHub
#beginners
<
2018-02-04
>
derpocious15:02:41

hey all, I'm wondering is there a library for reading and writing to datomic database from cljs?

derpocious15:02:24

I could only find datascript, "an in memory datamoic-like data store"

derpocious15:02:20

or dataomic-cljs lib that is 0.0.1 alpha 😕

gklijs16:02:10

@derpocious It would not surprise me if there was no such thing. You have so many options to get data to/from js, that an universal solution is hard. Which data do you want to show? How to format data? How should the client serialize?

derpocious16:02:47

I'm making a cljs lambda service on aws, and from that I want to read data from the datomic database

Nick Stares18:02:14

I'm trying to add https://www.ocpsoft.org/prettytime/nlp/ as a dependency with leiningen. In my project.clj I have:

:dependencies [[org.clojure/clojure "1.9.0"]
[http-kit "2.1.18"]
[compojure "1.4.0"]
[ring/ring-defaults "0.1.5"]
[org.clojure/java.jdbc "LATEST"]
[org.postgresql/postgresql "LATEST"]
[org.ocpsoft.prettytime/prettytime-nlp "LATEST"]] 
and also :repositories {"sonartype snapshots" ""} I ran lein deps and got:
Retrieving org/ocpsoft/prettytime/prettytime-nlp/4.0.1.Final/prettytime-nlp-4.0.1.Final.pom from central
Retrieving org/ocpsoft/prettytime/prettytime-nlp/4.0.1.Final/prettytime-nlp-4.0.1.Final.jar from central
Could not find artifact org.ocpsoft.prettytime:prettytime-parent:pom:4.0.1-SNAPSHOT in clojars ()
I tried adding [org.ocpsoft.prettytime/prettytime-parent "LATEST"] and then I got
Retrieving org/ocpsoft/prettytime/prettytime-parent/4.0.1.Final/prettytime-parent-4.0.1.Final.pom from central
Retrieving org/ocpsoft/ocpsoft-parent/10/ocpsoft-parent-10.pom from central
Could not find artifact org.ocpsoft.prettytime:prettytime-parent:jar:4.0.1.Final in central ()
Could not find artifact org.ocpsoft.prettytime:prettytime-parent:pom:4.0.1-SNAPSHOT in clojars ()
What am I doing wrong?

alexmiller19:02:18

prettytime-parent is just a pom, not a jar, so typically you don’t need to add it as a dependency

Nick Stares19:02:22

so why is it looking for the pom snapshot in clojars if it already found it in central?

Nick Stares19:02:22

(in the first error message)

alexmiller21:02:30

notice it is finding the pom, but you’ve asked it to find the jar. it checks central, but can’t find it, because it doesn’t exist. then it checks clojars and also can’t find it there

alexmiller21:02:03

there is no reason to add prettytime-parent as a dependency

Nick Stares21:02:00

sorry, I meant that in the first set of messages (before I added prettytime-parent as a dependency), it says that it is able to find prettytime-nlp-4.0.1.Final.pom and prettytime-nlp-4.0.1.Final.jar from central, but then it can't find prettytime-parent:pom:4.0.1-SNAPSHOT in clojars. I guess what I'm wondering is why is it looking for the SNAPSHOT when it's able to find Final?

sb09:02:36

Sometimes easier install to local repo manually. Eg. mvn deploy:deploy-file -DgroupId=local.oracle -DartifactId=javafxrt -Dversion=2.2.0 -Dpackaging=jar -Dfile=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext/jfxrt.jar -Durl=file:vendor/mvn

sb09:02:43

you can see from pom the data for this

Nick Stares12:02:05

Ok, I'm reading the maven deploy docs and just want to make sure I understand. So I'd download a .jar manually from a mirror like http://jcenter.bintray.com/org/ocpsoft/prettytime/prettytime-nlp/4.0.1.Final/ Then my command would look something like this: mvn deploy:deploy-file -DgroupId=org.ocpsoft.prettytime -DartifactId=prettytime-nlp -Dversion=4.0.1.Final -Dpackaging=jar -Dfile=~/path/to/where/i/downloaded/the/jar Durl=file:~/.m2 Does that seem about right?

sb16:02:07

I didn't check, but sounds ok. In this case your local repo ~/.m2, don't forget to load.