Questions tagged [quill.io]

A library that allows you to write queries in Scala with QDSL (Quoted Domain Specific Language). The queries then get executed in the query language of your choice (SQL, CQL, etc.).

Quill provides a Quoted Domain Specific Language (QDSL) to express queries in Scala and execute them in a target language. The library’s core is designed to support multiple target languages, currently featuring specializations for and .

  1. Boilerplate-free mapping. The database schema is mapped using simple case classes.
  2. Quoted DSL. Queries are defined inside a quote block. Quill parses each quoted block of code (quotation) at compile time and translates them to an internal Abstract Syntax Tree (AST)
  3. Compile-time query generation. The Context.run call reads the quotation’s AST and translates it to the target language at compile time, emitting the query string as a compilation message. As the query string is known at compile time, the runtime overhead is very low and similar to using the database driver directly.
  4. Compile-time query validation. If configured, the query is verified against the database at compile time and the compilation fails if it is not valid. The query validation does not alter the database state.

Resources:

41 questions
1
vote
1 answer

Quill SQL query logging with values as `?`

I am new to Quill, I want to log the SQL query with values,but at the moment, the values are replaced by ? in the query. My configuration in logback_core_config.xml is and my query is printing as SELECT…
user9920500
  • 606
  • 7
  • 21
1
vote
2 answers

Cannot reuse a function for quill SQL filtering

I have a case class Employee case class Employee(id: Int, name: String, age: Int, is_permanent: Boolean, company_name: String) I am filtering on this Employee case class using Quill…
user9920500
  • 606
  • 7
  • 21
1
vote
1 answer

Quill way of doing INSERT INTO ... SELECT FROM

I'm trying to translate simple INSERT INTO...SELECT FROM query into a quote in Quill. First of all, I am failing to find a built-in way to do this, so ended up trying out to use infix query val rawQuery = quote { (secondTableValues: List[Int]) => { …
vtor
  • 8,989
  • 7
  • 51
  • 67
1
vote
1 answer

writing script in scala to join two mysql tables and create one object (quill)

I have two mysql tables: Owners & Pets Owner case class: Owner(id: Int, name: String, age: Int) Pet case class: Pet(id: Int, ownerId: Int, type: String, name: String) I want to create out of those tables list of OwnerAndPets: case class…
JohnBigs
  • 2,691
  • 3
  • 31
  • 61
1
vote
1 answer

Scala Quill error when using infix

I run into problem when using Quill's infix operation . Scala 2.12.4 Quill 2.3.3 import io.getquill._ val ctx = new SqlMirrorContext(PostgresDialect, SnakeCase) import ctx._ // infix for custom DB operation implicit class StringQuotes(left:…
WeiChing 林煒清
  • 4,452
  • 3
  • 30
  • 65
1
vote
0 answers

Cassandra quill Codec not found for requested operation

I followed the example given in the docs but the following fails with Codec not found for requested operation: [varchar <-> java.util.UUID]. How is one supposed to provide a custom Cassandra codec with Quill? import java.util.UUID import…
Todor Kolev
  • 1,432
  • 1
  • 16
  • 33
1
vote
1 answer

Scala quill "quote" not resolving

I'm trying to write database queries with quill for scala. (Quill) I'm following what they're doing on quill's website but for some reason I cannot resolve the 'quote' method and a few others. Any ideas? Here's my build.sbt: name := "Pop" version…
Ryan Stull
  • 1,056
  • 14
  • 35
0
votes
0 answers

Batch insert is throwing error with Quill.io with mariadb when using Monix

On mariadb 10.5.9 and scala 2.13 using MysqlMonixJdbcContext from getquill.io and trying to do a batch insert with import io.getquill._ val ctx = new MysqlMonixJdbcContext(SnakeCase, "ctx") import ctx._ val images: List[Image] = ... run( …
Akhil
  • 538
  • 5
  • 13
0
votes
1 answer

Using function to update case class value in scala Quill

I have following case class case class Tag(key: String, value: String, modifiedDate: Date) And I have a data access object that looks like this: class TagDao(implicit val ec: ExecutionContext, val ctx: PostgresAsyncContext[SnakeCase]) { def…
Shamshad Alam
  • 1,684
  • 3
  • 19
  • 31
0
votes
1 answer

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

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…
user9920500
  • 606
  • 7
  • 21
0
votes
1 answer

Is it possible to update multiple rows with Quill using IN

It is possible to produce something like UPDATE employees SET gender = 'Male' WHERE id IN ('asfd','bleh'); with Quill? I don't find and example in the documentation, and batch update seems to be something else.
Tae
  • 1,665
  • 5
  • 24
  • 45
0
votes
1 answer

exception during macro expansion: [error] java.lang.IllegalStateException: Invalid group by aggregation:

I have a table like this in MYSQL. create table Employee( id tinyint, name char(36), is_permanent tinyint, company_name char(36), designation Char(36), primary key (id) ); and I want to write a SELECT query on this table with Quill SQL. …
user9920500
  • 606
  • 7
  • 21
0
votes
0 answers

How to set unique constraint in Quill.io with case class

I am using quill library and mapping entities via case classes case class Country(id: Long, name: String) How can I set unique constraint on name field?
0
votes
0 answers

Scala Quill incorrect parses when two level Option Embedded classes

Quill does not parse embedded option class if it's two-level option embedded class is None Version: 3.4.10 Module: quill-jdbc-monix Database: postgresql Steps to reproduce the behavior I have the next classes: case class Customer(id: String,…
Anar Amrastanov
  • 385
  • 1
  • 3
  • 13
0
votes
0 answers

Does anyone know how to setup the latest playframe work project with Quill

I running 2.12/play2.7 project and would like to use Quill.io as the database layer. Does anyone know how to set up such a combination? I tried to use the https://github.com/getquill/play-quill-jdbc as starting point, but could not get it to…