Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:48
    romanovsky starred getquill/quill
  • Jan 19 21:48
    mgibowski synchronize #2041
  • Jan 18 15:11
    giovannimorlin starred getquill/quill
  • Jan 18 11:17
    JNKHunter starred getquill/quill
  • Jan 17 13:23
    scala-steward opened #2066
  • Jan 17 13:23
    scala-steward closed #2038
  • Jan 17 13:23
    scala-steward commented #2038
  • Jan 17 13:23
    scala-steward opened #2065
  • Jan 16 01:11
    kubukoz opened #2064
  • Jan 15 06:31
    dnim starred getquill/quill
  • Jan 15 00:11
    ks228 starred getquill/quill
  • Jan 14 10:40
    andreami starred getquill/quill
  • Jan 14 05:27
    sqrtqiezi starred getquill/quill
  • Jan 14 01:12
    kumar-ish starred getquill/quill
  • Jan 12 10:30
    Matzz commented #2043
  • Jan 12 03:54

    deusaquilus on minor_quat_fixes_3

    Incorrect var (compare)

  • Jan 12 03:32

    deusaquilus on minor_quat_fixes_3

    Take2 (compare)

  • Jan 12 02:09

    deusaquilus on minor_quat_fixes_3

    Memoize quats (compare)

  • Jan 11 14:54

    deusaquilus on minor_quat_fixes_2

    Caching Quats (compare)

  • Jan 11 08:34

    deusaquilus on master

    Minior Quat Fixes and More Tests Cache env lookups for better pe… Merge pull request #2057 from g… (compare)

Alexander Ioffe
@deusaquilus
It requires a small change in Parsing.scala and a small change in ValueComputation (I think)
Alexander Ioffe
@deusaquilus
If you want to pursue this, I can create a issue describing exactly what to go to implement it
Eduardo Barrientos
@kdoomsday

Hi! When trying to run docker-compose run --rm sbt sbt test I get the following error:

Get:3 http://deb.debian.org/debian stretch/main amd64 nodejs amd64 4.8.2~dfsg-1 [3440 kB]
E: Failed to fetch http://deb.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u3_amd64.deb  404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Any pointers for fixing this would be appreciated

Alexander Ioffe
@deusaquilus
I recently pushed a fix for this, that container needs a apt-get update before installing node to get to the right repo
Are you on a branch or working off of master?
Eduardo Barrientos
@kdoomsday
I'm working on master on a fork
Eduardo Barrientos
@kdoomsday
And yes, that last fix solved it for me. Thanks!
Yisrael Union
@yisraelU
@deusaquilus done ty. getquill/quill#2062
nafg
@nafg
@deusaquilus what about being able to define an explicit projection? I guess it's different in Slick where the building blocks are columns so you can map to/from tuples, Quill needs named case class fields... but then shouldn't it be possible to go lower level than that? Case class field names are a nice convenience but they don't seem like a good building block to build abstractions on top of
Typeclasses don't feel like the right tool for the job to me
Let me turn the question around though, why don't nested case classes work by default? You can probably give a more definitive answer, my guess would be:
(1) Some backends support nested data
(2) Just because a field is a case class doesn't mean it doesn't get mapped to a single field
(3) Since field names are usually significant, should the name of the field of the embedded case class just be ignored? That feels inconsistent. (As in, class class Outer(field1: Int, ignoredName: SomeEmbeddedCaseClass))
nafg
@nafg
If the only issue was (2), you could argue that the default should be to nest (flatten), and the presence of a typeclass allows Quill to encode it as a single field
Point (1) suggests that the behavior might be backend-dependent, but that might not be desired. Not sure.
Point (3) is not the biggest deal, but I could hear an argument that the column names might in some cases make sense to be a combination of the outer field name and the inner field name
For example given case class Person(name: String) and case class Row(owner: Person) the field name would be owner_name
But in other cases that's not desirable
nafg
@nafg
Again, if for such cases I don't have to rely on Quill guessing a bunch of stuff based on my field names, but I could have more explicit building blocks, like a first-class Column type, that I could build my own abstractions on top of (as I do in Slick), it would enable a lot of possibilities
Then by default Quill generates those Columns based on a class class' field names and types (and implicits for those types), but you could override that behavior
vonchav
@voonchav_gitlab

Hi all,
I'm trying to refactor the following dynamic query into a compile-time version:

      val query = if (fetchingForward)
        quote {
          filterBy(criteria).sortBy(_.id)(Ord.desc)
        }
      else
        quote {
          filterBy(criteria).sortBy(_.id)(Ord.asc)
        }

I was trying the following:

    val sortOrder: Ord[Int] = if (fetchingForward) Ord.desc else Ord.asc

    val query = quote {
      filterBy(criteria).sortBy(_.id)(lift(sortOrder))
    }

However, I'm getting the exception during macro expansion error. Any suggestion on how I can fix this? Cheers.

2 replies
Swoorup Joshi
@Swoorup
does quill support scala 3?
1 reply
Yannick
@fishb6nes
Is it possible to override how quill decodes and encodes LocalDateTime fields? I have a custom implicit MappedEncoding imported but it appears to be ignored (as it would be mapping to an ISO string but is still mapped to what looks like an epoch second in stead). Is there any extra configuration to override the dencoders for those types that Quill is already aware of?
Jack Henahan
@jhenahan
Are there docs or a guide for writing and using a custom dialect with Quill? I interact with Vertica at work a lot, and having a nicer way to write queries than throwing strings at their JDBC would be magic
(Obviously I'd be happy to PR it back upstream if I get it working)
Dan Di Spaltro
@dispalt
@fishb6nes an approach is to make a newtype like https://github.com/estatico/scala-newtype or shapeless tagged type, and do the mappedEncoding with that type.
Yannick
@fishb6nes
Aah thank you @dispalt tagged types look interesting, I should probably use those in more places
dweeb azoid
@shnerk_twitter
I am trying to filter a Union of 2 results by a value from a separate quote, is that possible?
val date = quote{query[Object].map(d=>d.DateTimeP)}
sven42
@sven42

Hello,

what is the current recommendation about what async context to use with Quill 3.6.0 for PostgreSQL and with Scala 2.13?
There are some alternatives, but

  • quill-async-postgres seems to be discontinued and buggy,
  • quill-jasync-postgres seems not to be the official replacement and
  • quill-ndbc-postgres is still not released for 2.13 (#1727)
Alexander Ioffe
@deusaquilus
@sven42 I think quill-jasync-postgres is the official replacement.
I would like to deprecate Quill Scala 2.11 Javascript. All JVM 2.11 modules will remain for now. Does anyone have critical use-cases for this library?
sven42
@sven42
Thank you very much @deusaquilus
Yisrael Union
@yisraelU
is there any documentation\videos that i can consume that will help me understand the internals of quill ?
Alexander Ioffe
@deusaquilus
@yisraelU Check out this series. I go through implementing a mini-quill in Scala 3. This goes faily deep into Parsing and Quotation. Doesn’t cover lifts and encoders/decoders though.
1 reply
nafg
@nafg
@deusaquilus hi, any thoughts on my points above?
Yisrael Union
@yisraelU

is there any way to reuse querySchema definitions. for example

case class Person(name: String, age: Int) extends Embedded
case class Unit(stuff:Int,person:Person)
val q = quote{querySchema[Person]("table",
                                 _.name-> "NAMED",_.age->"MyAge")}
val m = ctx.run(query[Unit].filter(p => p.person.name == "John"))

I would like to be able to use the schema defined for Person in the query defined for Unit either through implicits or combining 2 querySchemas

Oleg Pyzhcov
@oleg-py
Hey guys, what's the proper way to do update ... returning that typechecks to a list of results? I'm using quill-jdbc-monix 3.6.0 with postgres
priyankadhiman0803
@priyankadhiman0803

Table case class is

case class DailyOrgActivity(
    orgId: UUID,
    date: String,
    nuggetId: UUID,
    userId: String)

want to filter between startTime and endTime which are both org.joda.time.Datetime
how to do that in easy and effectibve way.
Right now I am getting a List(string ) between these two dates and using
.filter(activity => liftQuery(inDatesChunk).contains(activity.date))
but it is not a good way.

2 replies
Aditya Prasad
@monktastic
Hi! If I have a field in my domain object that is itself a case class with a few fields, how do I tell Quill to store them as separate fields in the db?
Aditya Prasad
@monktastic
Aditya Prasad
@monktastic
What about if I want to store the case class as a single field using custom serialization/deserialization logic?
1 reply
dwlizlo
@dwlizlo
@deusaquilus as for the quill and doobie integration. When it comes to data selection support only ConnectionIO[List[]] or there is a way to get ConnectionIO[Option[]] / ConnectionIO[_]?
dwlizlo
@dwlizlo
I kinda answered it myself. Quill in general returns only list of results as SQL databases in general return flat list of values (0..n)
Ashutosh
@ashutosh-shirole
Hi! Is it possible to use this library with Java 8/11 instead of scala? If yes, where can I find some examples?
Lorenzo Gabriele
@lolgab
@ashutosh-shirole Directly in Java I don't think so because it is based on macros that are ran by the Scala Compiler at compile time. You could instead write a java interface with all the methods you need, returning java types and collections, and implement this interface in Scala using Quill. This should be possible.
Ashutosh
@ashutosh-shirole
@lolgab Thats what I thought too. Thanks for the answer. :+1:
Michał Gibowski
@mgibowski
Hi, there is a small PR of mine waiting for a review. It fixes an annoyance for MySQL users that have tables with many columns. Maybe it's not a very common problem, however as the changes are small, it would be awesome if it could get reviewed. Just updated the branch to the master. PR: getquill/quill#2041 Related issue: getquill/quill#1907