Skip to content

Instantly share code, notes, and snippets.

@onilton
Created February 25, 2016 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onilton/8a0c816ab67f46d4b118 to your computer and use it in GitHub Desktop.
Save onilton/8a0c816ab67f46d4b118 to your computer and use it in GitHub Desktop.
Quill 0.40 Query Probing Problem
package com.nobody
import io.getquill.JdbcSourceConfig
import io.getquill.naming.{ LowerCase, SnakeCase }
import io.getquill.sources.jdbc.JdbcSource
import io.getquill.sources.sql.idiom.MySQLDialect
import io.getquill._
object CustomDbSource {
type MyJdbcSourceConfig = JdbcSourceConfig[MySQLDialect, SnakeCase with LowerCase]
type MyJdbcSource = JdbcSource[MySQLDialect, SnakeCase with LowerCase]
}
case class Item(id: Int, name: String)
import CustomDbSource._
class MyRepository(db: MyJdbcSource) {
private val allItems = quote(query[Item])
def items(): Seq[Item] = {
db.run(allItems)
}
}
object MyApp {
def main(args: Array[String]): Unit = {
val dbSource = source(new MyJdbcSourceConfig("db"))
val myRepo = new MyRepository(dbSource)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment