Skip to content

Instantly share code, notes, and snippets.

@wilig
Created August 18, 2010 17:57
Show Gist options
  • Save wilig/535633 to your computer and use it in GitHub Desktop.
Save wilig/535633 to your computer and use it in GitHub Desktop.
sequel> (->> (collect :table1 :table2 [:table1/id :table2/name])
(filter (and (> :table1/id 5) (< :table1/id 15)))
(limit 100)
(offset 50)
(order-by (asc :table2/name))
(to-sql))
["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