quill.io

Running Plain SQL dynamically in Quill using infix fails with wrong query syntax during runtime

与世无争的帅哥 提交于 2020-03-05 00:32:40
问题 I want to construct my query in plain SQL and then run it using Quill, I am using infix operator . My code is like this. case class Employee(name: String, age: String, company_name: String) case class Company(name: String, pin_code: String) case class CombinedEmployee(employee_age: Int, employee_name: Option[String], company_name: String, pin: Option[String]) val sql = "SELECT t1.age AS employee_age, t1.name AS employee_name, t2.name AS company_name, t2.pin as pin FROM employee t1 JOIN

Running Plain SQL dynamically in Quill using infix fails with wrong query syntax during runtime

孤街醉人 提交于 2020-03-05 00:22:37
问题 I want to construct my query in plain SQL and then run it using Quill, I am using infix operator . My code is like this. case class Employee(name: String, age: String, company_name: String) case class Company(name: String, pin_code: String) case class CombinedEmployee(employee_age: Int, employee_name: Option[String], company_name: String, pin: Option[String]) val sql = "SELECT t1.age AS employee_age, t1.name AS employee_name, t2.name AS company_name, t2.pin as pin FROM employee t1 JOIN

`exception during macro expansion: [error] scala.reflect.macros.TypecheckException` when using quill

喜你入骨 提交于 2020-01-15 11:43:09
问题 I'm pretty new to Scala, Play, and Quill and I'm not sure what I'm doing wrong. I have my project split up into models, repositories, and services (and controllers, but that is not relevant for this question). Right now, I'm getting this error for the lines in my services that are making changes to the database: exception during macro expansion: scala.reflect.macros.TypecheckException: Can't find implicit `Decoder[models.AgentId]`. Please, do one of the following things: 1. ensure that

Generic Macros with Quill

本小妞迷上赌 提交于 2019-12-23 04:54:36
问题 Hi so I've been trying to create some generic functions using macros and Quill. Here is my implementation of the macro: class Impl(val c: Context) { import c.universe._ def all[T](tblName: Tree, ctx: Tree)(implicit t: WeakTypeTag[T]): Tree = q""" import ${ctx}._ implicit val schema = schemaMeta[$t](${tblName}) run(quote { query[$t] }) """ } object Macros { def all[T](tblName: String, ctx: MysqlAsyncContext[Literal.type]): Future[List[T]] = macro Impl.all[T] } And I've tried using it in the

Failing to use transactions in Quill to INSERT one-to-many relational objects

ぐ巨炮叔叔 提交于 2019-12-12 21:15:02
问题 I have a person table and animal table and in the animal table there is FK to personId since there is one-to-many relation between them. I just want to create a person and create its animals using a transaction cause I want the process to be atomic (there is no use of person in the db if I could not create its animals) This is the model of how I accept a person creation request: case class PersonCreateRequest(name: String, age: Int, animals: Seq[AnimalCreateRequest]) This is how the DB knows

Failed to load data source for config using Play-2.6 and Quill.io

混江龙づ霸主 提交于 2019-12-11 18:21:25
问题 I'm currently getting an error when I try to run my Play app. It says Failed to load data source but then it looks like it is indeed loading the data source. I'm very new to Play and Scala and the rest of my team is also new, so apologies if this is a silly error or if I'm missing some code samples. Database app-users with owner root exists on my local and I don't believe root has a password (created using the createuser tool). Any ideas on what could cause this? Or what I am missing? Error: