walkable-server / walkable

A Clojure(script) SQL library for building APIs: Datomic® (GraphQL-ish) pull syntax, data driven configuration, dynamic filtering with relations in mind
https://walkable.gitlab.io/
Eclipse Public License 2.0
444 stars 15 forks source link

AtomicVariable in filters/extra-conditions bleeds through to sql #167

Closed andrewsuzuki closed 4 years ago

andrewsuzuki commented 4 years ago
;; floor plan
{:idents {:account/all "account"}
 :true-columns #{:account/id :account/organization-id}
 :extra-conditions {:account/all [:= :account/organization-id 3]
...}
;; query using extra-conditions
`[{:account/all [:account/id]}]
;; query using supplied conditions
`[{(:account/all {:filters [:= :account/organization-id 3]}) [:account/id]}]

results in this sql:

[SELECT ("account"."id")
AS "account/id"
FROM "account"
WHERE ((?)=(3)) #walkable.sql_query_builder.expressions.AtomicVariable{:name :account/organization-id}]
]
andrewsuzuki commented 4 years ago

Whoops, messed up my :true-columns. Carry on.