Skip to content

Instantly share code, notes, and snippets.

@eishay
Created May 2, 2016 22:57
Show Gist options
  • Save eishay/8e3a31ffdeb5bab978d9fbc6761255ac to your computer and use it in GitHub Desktop.
Save eishay/8e3a31ffdeb5bab978d9fbc6761255ac to your computer and use it in GitHub Desktop.
db.readOnly { implicit session =>
val conn = session.conn
val st = conn.createStatement()
...
val sql =
s"""
select CONCAT(something, "-", other_thing, "-", YEAR(created_at))
from some_table
where created_at >= ${db.dialect.day(startDate)} and
created_at < ${db.dialect.day(endDate)};
"""
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment