korma / Korma

Tasty SQL for Clojure.
http://sqlkorma.com
1.48k stars 222 forks source link

Aliasing entities in (with ..) #394

Open Janderio opened 6 years ago

Janderio commented 6 years ago

Possible I did not find the answer and it already exist somewhere here, but is it possible to alias entity names in (with ..)?

Example something like:

(with orders
    (with address) ;delivery
    (with contact ;person responsible
        (with address))) ;;and the address for invoices of this persons order

would produce java.sql.SQLSyntaxErrorException: Not unique table/alias: address possible way to solve:

(with orders
    (with address :as :delivery_address) ;delivery
    (with contact ;person responsible
        (with address :as :invoice_address))) ;;and the address for invoices of this persons order

But this does not work, again mariadb with mysql adapter and [korma "0.4.3"]