Created
February 25, 2016 19:22
-
-
Save onilton/8a0c816ab67f46d4b118 to your computer and use it in GitHub Desktop.
Quill 0.40 Query Probing Problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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