com.github.njeuk.dbmapper
Provides query interpolation, similar to standard Scala string interpolation.
Example
val name = "Bruce" val bruce = DbAsync.exec[Person](q"select * from person where name = $name")
Lists are supported, as in:
val names = List("Bruce", "Murray", "Charlene") val australians = DbAsync.exec[Person](q"select * from person where name in ($names)")
To perform string interpolation within the query, prefix the $ with a ' as in:
val table = "person" val people = DbAsync.exec[Person](q"select * from '$table")
For longer queries you can join the strings with +, as in:
val newZealanders = DbAsync.exec[Person](q"select * from person " + q"where smarter = 't' and " + q"good_looking = 't'");
Provides query interpolation, similar to standard Scala string interpolation.
Example
Lists are supported, as in:
To perform string interpolation within the query, prefix the $ with a ' as in:
Lists are supported, as in:
For longer queries you can join the strings with +, as in: