LauJensen / clojureql

ClojureQL is superior SQL integration for Clojure
https://clojureql.sabrecms.com
Eclipse Public License 1.0
285 stars 39 forks source link

projecting from an aliased column on a joined table creates broken SQL #46

Closed doooks closed 13 years ago

doooks commented 13 years ago

I have committed a test at 0f8bfd5a4e18f8d8569f3265d08c017adc243798 that covers the bug. I believe l0st3d committed a fix on c20222d4bba7b3b875070c7e93ed8b3f41826e55 but this hasn't been merged.

Hope this can get fixed for 1.0.0. Regards Dan

LauJensen commented 13 years ago

Looking at it now. It needs to be fixed, but I dont see a need to "prepend-tablename" when we already have "to-tablename" which is just misbehaving.

LauJensen commented 13 years ago

Hi Dan,

This gave me an opportunity to do a much needed rewrite of some internal functions, it should be fixed now. You should note however that you test is technically broken, it works now because of the wonders of flexibility.

You wrote: (project [:one :as :two]), which technically shouldn't work since renames should always be a vector of their own, ie (project [[:one :as :two]]), you clearly see that makes sense when you have multiple fields (project [:one [:two :as :three]]) etc.

Thanks for bring this up, was an important issue! Lau

LauJensen commented 13 years ago

Fixed