cgrand / sqrel

The SQL library that won't drive you nuts.
37 stars 2 forks source link

Unconstrained rels generate incorrect SQL queries #1

Open ummels opened 11 years ago

ummels commented 11 years ago

If I appy sql to a rel generate by table, the generated SQL query does not contain the table name, so select fails:

=> (def t (table "test"))
=> (sql t)
"SELECT * FROM ()"

Is this a bug or is select not designed to work with simple rels?

cgrand commented 11 years ago

Thanks for giving sqrel a try! Any feedback/overall feeling is very welcome.

Currently it's a regression but note that if you specify the columns you want, select works.

On Mon, May 6, 2013 at 1:15 PM, Michael Ummels notifications@github.comwrote:

If I appy sql to a rel generate by table, the generated SQL query does not contain the table name, so select fails:

=> (def t (table "test")) => (sql t) "SELECT * FROM ()"

Is this a bug or is select not designed to work with simple rels?

— Reply to this email directly or view it on GitHubhttps://github.com/cgrand/sqrel/issues/1 .

On Clojure http://clj-me.cgrand.net/ Clojure Programming http://clojurebook.com Training, Consulting & Contracting http://lambdanext.eu/

ummels commented 11 years ago

Thanks for your reply! How do I specify the columns I want? Neither (select (:name employee)) nor (select :name employee) seems to work.