Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:58
    juliano synchronize #1669
  • 08:57

    juliano on master

    Update typesafe:config to 1.4.0… (compare)

  • 08:57
    juliano closed #1668
  • Oct 13 19:07
    scala-steward opened #1670
  • Oct 13 19:07
    scala-steward opened #1669
  • Oct 13 10:24
    juliano synchronize #1668
  • Oct 13 10:23

    juliano on master

    Update orientdb-graphdb to 3.0.… (compare)

  • Oct 13 10:23
    juliano closed #1667
  • Oct 12 17:52
    scala-steward opened #1668
  • Oct 12 14:55
    victorwins starred getquill/quill
  • Oct 12 12:41
    mdedetrich synchronize #1635
  • Oct 11 15:32
    scala-steward opened #1667
  • Oct 11 13:38
    amin-abutaleb-tw starred getquill/quill
  • Oct 11 11:59
    xWvxYWYxvWx edited #1666
  • Oct 11 11:58
    xWvxYWYxvWx edited #1666
  • Oct 11 11:58
    xWvxYWYxvWx edited #1666
  • Oct 11 11:57
    xWvxYWYxvWx opened #1666
  • Oct 11 09:18
    onzo-dave-hinton opened #1665
  • Oct 11 09:04
    juliano synchronize #1664
  • Oct 11 09:03

    juliano on master

    Update sbt-mima-plugin to 0.6.1… (compare)

Michael Genereux
@mgenereu
Since my whole stack is based on Li's code, I'm waiting too. ;-)
Matthew de Detrich
@mdedetrich
@deusaquilus @juliano new PR here, I have decided to make a separate PR to remove the redundant null checks that I talked about earlier.
I will then rebase my datetime DSL PR once this is merged into master
Matthew de Detrich
@mdedetrich
Also I am getting a lot of CI errors, is there something wrong with travis currently?
Matthew de Detrich
@mdedetrich
Okay, getquill/quill#1648 is ready to merge!
Juliano Alves
@juliano
merged! Thanks @mdedetrich :)
Li Haoyi
@lihaoyi
is there an easy way to ask for an untyped "resultset" or "row" of stuff in quill?
e.g. I want to do ctx.run(infix"select * from information_schema.tables".as[???]) and have it show me what tables exist, but I don't care what format it is in, as long as I can read it
Li Haoyi
@lihaoyi
I’m tryying to do the basic “list tables” “list columns” stuff that you normally do in psql, but do it in quill instead
Kostya Golikov
@lazyval
Hi! Is there a way to specify a fetch size without using quill-jdbc-monix?
Matthew de Detrich
@mdedetrich
What do you mean by fetch size?
@lihaoyi Can't you just do exists?
i.e.
scala ctx.run(query[InfromationSchema.Tables].exists)`
Kostya Golikov
@lazyval
I mean the hint that you usually specify in jdbc driver / statement level to say how much rows to fetch in one round trip.
https://stackoverflow.com/a/15559710
there was a discussion in gitter previously, as some people wanted to set this hint to 1, to fetch one row at a time, but my use-case is the opposite: I know, in advance, that a specific query gonna return a lot of rows and when I profile it I see there is a lot of roundtrips done to the db, so I would love to bump it somehow from the default value of 10.
todd-son
@todd-son

I want to use raw sql in quill.
Invalid sql was executed.

SELECT x._1, x._2 FROM (SELECT NAME, AGE FROM EAMON_BATCH_PERSON WHERE NAME = 'todd')

My code is

val selectSql = quote {
      (name: String) => infix"""SELECT NAME, AGE FROM EAMON_BATCH_PERSON WHERE NAME = $name""".as[Query[(String, Int)]]
    }

    val result: List[(String, Index)] = run {
      selectSql("todd")
    }

Alias for columns was not generated.
Quill jdbc version is 3.4.9

Li Haoyi
@lihaoyi-databricks
found a new crasher if anyone wants to look :) getquill/quill#1655
Li Haoyi
@lihaoyi-databricks
or if anyone has any hints for workarounds
seems like a pretty straightforward query, so not sure what I can do to shuffle it around and make the macros happy
Li Haoyi
@lihaoyi-databricks
after I define a implicit val encodeInstant: Encoder[java.time.Instant] to allow serializing and deserializing instants to my database, is there a way to perform timestamp arithmetic in the database using Quill?
Matthew de Detrich
@mdedetrich

is there a way to perform timestamp arithmetic in the database using Quill?

I am in the process of writing a DSL for this

Regarding #1655 , I think the issue is with lift(now) - r.timestamp > s._2
Typically I had to create custom infix's to support this, i.e. see https://github.com/mdedetrich/quill-interval-bug/tree/fix/src/main/scala
Li Haoyi
@lihaoyi
thanks, i’ll use an infix for now
Alexander Ioffe
@deusaquilus
@all 3.4.10 is out with support for Scala 2.13. Much thanks to @jilen for making this happen!
Li Haoyi
@lihaoyi
:+1:
Oleg Pyzhcov
@oleg-py

Hey guys, anybody saw something like this:

[error] scala.reflect.macros.TypecheckException: package com.testproject.data is not a value
[error]         at scala.reflect.macros.contexts.Typers.$anonfun$typecheck$3(Typers.scala:44)
[error]         at scala.reflect.macros.contexts.Typers.$anonfun$typecheck$2(Typers.scala:38)
[error]         at scala.reflect.macros.contexts.Typers.doTypecheck$1(Typers.scala:37)
[error]         at scala.reflect.macros.contexts.Typers.$anonfun$typecheck$7(Typers.scala:50)
[error]         at scala.reflect.internal.Trees.wrappingIntoTerm(Trees.scala:1756)
[error]         at scala.reflect.internal.Trees.wrappingIntoTerm$(Trees.scala:1753)
[error]         at scala.reflect.internal.SymbolTable.wrappingIntoTerm(SymbolTable.scala:28)
[error]         at scala.reflect.macros.contexts.Typers.typecheck(Typers.scala:50)
[error]         at scala.reflect.macros.contexts.Typers.typecheck$(Typers.scala:32)
[error]         at scala.reflect.macros.contexts.Context.typecheck(Context.scala:18)
[error]         at scala.reflect.macros.contexts.Context.typecheck(Context.scala:18)
[error]         at io.getquill.quotation.Parsing$$anonfun$propertyParser$1.applyOrElse(Parsing.scala:488)
[error]         at io.getquill.quotation.Parsing$$anonfun$propertyParser$1.applyOrElse(Parsing.scala:474)

In my case com.testproject.data is a package that has package object with some type aliases, and it comes from a different subproject entirely

Oleg Pyzhcov
@oleg-py
seems to be caused by usage of a constant enum value (from enumeratum) without lift
Filipe Moura
@filipe.moura_gitlab
How can I sort by a column from a option left join?
Matthew de Detrich
@mdedetrich
@oleg-py Indeed, we don't support lifting constant values from unsupported types
In order to do this you would have to make a system for macros that would, at compile time, evaluated the enum straight into its relevant sql type which would require changes to both io.quill.Encoder and io.quill.Decoder
Oleg Pyzhcov
@oleg-py
Sounds ok to me, but I'd love a better compile error
Matthew de Detrich
@mdedetrich
Sure, can you create an issue for it so we can track it?
Filipe Moura
@filipe.moura_gitlab
Hi all, How can I sort by a column from a option left join? Any help?
Leo
@leobenkel
Hello, are with clause supported ?
dvir
@dvirf1
:point_up: October 8, 2019 7:07 AM
Thanks @jilen :)
Hubert Słojewski
@Hoobie
Hi, I have a question about Cassandra support. How to perform operations on the list type, using existing elements, is it possible to filter them?
sth like this doesn't work
update(
  report => {
    report.workChunks -> report.workChunks
      .filter(_.uuid != lift(uuid))
    },
)
Li Haoyi
@lihaoyi-databricks

Hi! I'm getting an error with the following update:

    svc.ctx.run{
      query[db.Run]
        .filter(r => liftQuery(timedOutWorkers.map(_.id)).contains(r.workerId))
        .foreach{r =>
          query[db.RunEvent].insert(
            _.runId -> r.id,
            _.timestamp -> lift(Instant.now()),
            _.status -> lift(db.RunStatus.aborted)
          )
        }
    }

It's saying "Batch actions must be static quotations". Any idea if there's a way to workaround this?

basically I want to do a filter, and then for the results of the filter insert things into a separate table
Oleg Pyzhcov
@oleg-py
You can probably try something dumb:
            _.timestamp -> infix"NOW()".as[Instant],
            _.status -> infix"'aborted'".as[RunStatus]
or maybe you can do query[...].filter[...].map(e => (e, lift(Instant.now()), lift(db.RunStatus.aborted))).foreach { ... }
depends on semantics you want from that Instant.now, I guess
Li Haoyi
@lihaoyi-databricks
interesting, yeah that should work
Li Haoyi
@lihaoyi-databricks
@deusaquilus do you think it would be possible to separate Quill's database-connection-and-transaction context and its compile-time-code-generation context into two separate objects?
I ask because the fact that the compile-time stuff is on the same ctx that I have to dependency-inject all over the place causes tons of problems e.g. due to path-dependent types not lining up
but in reality all I need to do is pass around an untyped database connection; all the compile-time/type-related stuff never changes across my codebase and really could be a global object
I know Quill can be configured to just generate SQL strings, so in theory I should be able to configure it to do the SQL-string part using a global object and only pass around the database connection in ctx
but not sure how hard that would be in practice