Fork me on GitHub
#om
<
2016-06-27
>
afhammad10:06:42

I haven’t seen any non trivial remote parser examples that handle queries with more than a flat request. A non-datmoic db example would also be helpful. Any such examples?

jimmy10:06:03

can you post your example here ?

afhammad10:06:35

@nxqd: lets say I have 2 components, OrgsList which has many OrgCard children. OrgCard wants [:id :name] from orgs collection, and also [:id :name] of the org’s projects, where a project belongs to an org. How should the OrgCard query look, and how should it be handled on the server?

jimmy10:06:55

have you tried to handle it on server ?

jimmy10:06:18

many has asked the question if datomic is required to use omnext, I would say no.

jimmy10:06:06

those cases, above you just need to return an array of map {:id 123 :name "something"}

jimmy10:06:46

you can construct sql query from om.next query to get the selected fields. Is this clear to you ?

afhammad11:06:09

constructing the db query is fine, i guess what’s unclear is parsing the ast query when it gets to the server, do you hard code to always look for “joins” such as projects in this case or is the read supposed to be generic to handle different queries (say one without projects, or with a different relation), also do you return projects nested under the orgs or as flat map with :orgs and :projects keys

jimmy11:06:14

parser on backend will be the same as frontend, it will handle keyed query like one on frontend. When you return result, just return in {:value ..} like in frontend, om next will gather all those information and return data as a tree like one in frontend.

dominicm11:06:37

https://juxt.pro/blog/posts/course-notes-2.html this may help with SQL. @nxqd could probably guide better on what it says though.

anmonteiro13:06:42

Just pushed Compassus 0.2.0 to Clojars. Notable changes from 0.1.0 are published here: https://github.com/anmonteiro/compassus/blob/master/CHANGELOG.md#020-2016-06-27

wilkerlucio14:06:10

how do I run the tests for the om library itself?

anmonteiro15:06:58

@wilkerlucio:

(require ‘om.next.tests)
(in-ns ‘om.next.tests)
(run-tests)

anmonteiro15:06:04

at the figwheel or node repl

dnolen16:06:54

@wilkerlucio: I saw your PRs but I noticed you have not sent me a CA want to PM your email?

dnolen16:06:31

@wilkerlucio: ok direct message me the email you want me to use

dnolen17:06:41

@wilkerlucio: PR merged thanks much

ag20:06:50

so what should I use to handle url-routing and history with om-next?

ag20:06:46

secretary ok?

ag20:06:10

@shaun-mahood: oh, wow.. it seems to be exactly what I was looking for.. great, thanks!