-
-
Notifications
You must be signed in to change notification settings - Fork 173
XTDB compatibility: nesting, exclude, rename #532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
user=> (sql/format '{select ((c._id customer_id), name,
((nest_many {select ((o._id order_id), value) from ((orders o)) where (= c._id o.customer_id) order-by ((order_date desc)) limit 3}) orders))
from ((customers c))})
["SELECT c._id AS customer_id, name,
NEST_MANY (SELECT o._id AS order_id, value FROM orders AS o WHERE c._id = o.customer_id ORDER BY order_date DESC LIMIT ?) AS orders
FROM customers AS c" 3]
user=> |
Optional user=> (sql/format '{from table where (= _id ?id)} {:params {:id 42}})
["FROM table WHERE _id = ?" 42] |
Extra SQL to think about:
|
and tests for nest_one, nest_many Signed-off-by: Sean Corfield <[email protected]>
Thanks @seancorfield, looking good 😊 I don't know if it makes a difference either to users or to HoneySQL implementation, but EXCLUDE and RENAME are syntactically part of the |
Since there's already a formatter that works with "select-like" things, and both However, now you mention that specifically, I assume things like None of this is listed on your https://docs.xtdb.com/reference/main/sql/queries.html railroad syntax diagrams tho'? |
[:get-in :people.info :contact 2 :tel] ; this is implemented |
Date/time literals with actual date/time values instead of strings: |
|
Signed-off-by: Sean Corfield <[email protected]>
I've added support for exclude/rename clauses in the "alias" position of a select item so for simple select *, you can use them at the top-level as shown above, but for selects with multiple elements, you can I've updated the tests to show this, as well as adding tests to show how the |
Signed-off-by: Sean Corfield <[email protected]>
Signed-off-by: Sean Corfield <[email protected]>
I've added inline map support (for clj and cljs) as a first step toward |
still need to add record/object special syntax Signed-off-by: Sean Corfield <[email protected]>
@jarohen Looking at the XTDB source, it looks like |
Signed-off-by: Sean Corfield <[email protected]>
Signed-off-by: Sean Corfield <[email protected]>
|
Everything except SETTING has a first pass implementation (without documentation!) so I'm going to deem this "done" so I can cut a release and get some feedback on the existing pieces. I'll also create a documentation ticket for all the XTDB stuff. |
SETTING has been implemented. |
I believe this is all documented as part of #556 |
See https://www.xtdb.com/blog/dev-diary-jun-24 for details.
:nest_one
,:nest_many
:select
:exclude
:rename
The text was updated successfully, but these errors were encountered: