Skip to content

Instantly share code, notes, and snippets.

@wilig
Created August 18, 2010 17:55
Show Gist options
  • Save wilig/535626 to your computer and use it in GitHub Desktop.
Save wilig/535626 to your computer and use it in GitHub Desktop.
sequel> (to-sql
(order-by (asc :table2/name)
(offset 50 (limit 100
(filter
(and (> :table1/id 5) (< :table1/id 15))
(collect :table1 :table2 [:table1/id :table2/name]))))))
["select table1.id, table2.name from table1, table2 WHERE (table1.id > ? AND table1.id < ?) LIMIT 100 OFFSET 50 ORDER BY table2.name ASC" 5 15]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment