Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Dmitry Smirnov
    @smrnv
    When I used not Option[LocalDateTime] i had the same issue
    Dmitry Smirnov
    @smrnv
    Oh, i'm sorry, my bad
    I solved the problem, there was a conflict between my implicits and DateTimeImplicits
    Dave Nicponski
    @virusdave

    Hi all! Multi part question for y'all.

    1) In a function where I have a scalar array parameter p of type Rep[List[X]], what's the "preferred" way of turning this into a Query[X, Rep[X], Seq? It isn't just p.unnest, apparently, which has type Rep[X].
    Looking at examples, it looks like Query(true).map(_ => p.unnest), which does have the right signature (albeit is a little weird).

    2) Let's say i have 2 array parameters p1 and p2 of the same cardinality. I want "a zip join of the unnested arrays". Pairs (a, b) where a from p1, and b from p2, where the indices for a and b match. How should i do this? Hint - It's not:

    Query(true).map(_ => p1.unnest).zip(Query(true).map(_ => p2.unnest))

    since this leads to a rather surprising sql behavior (at least on postgres) related to the ROW_NUMBER function being used for the zip join.

    Dave Nicponski
    @virusdave
    ^^ anyone?
    Dave Nicponski
    @virusdave
    @tminglei ^
    Dave Nicponski
    @virusdave
    Actually, what i'm really wanting to get at is WITH ORDINALITY https://www.postgresql.org/docs/current/static/functions-srf.html
    because then i can do a join on the ordinality (index) columns, to achieve the zip-like behavior i want
    Dave Nicponski
    @virusdave
    I take it that this room is dead?
    nafg
    @nafg
    Hi @tminglei you around?
    涂名雷
    @tminglei
    @melrief PgDate2Support is availabe for slick 3.1.1 as an addon, you can use libraryDependencies += "com.github.tminglei" %% "slick-pg_date2" % "0.14.6" to refer it. But in master for slick 3.2, I merged it into the main jar.
    涂名雷
    @tminglei
    @njouanin you need define TypeMapper for Instant List with AdvancedArrayJdbcType. And, you should use timestamp instead of instant as its pg type.
    @arussel slick/slick-pg can't generate select ARRAY(select stringfield from foos) yet.
    涂名雷
    @tminglei
    @Leonhalt3141 yes, you can give it a try.
    涂名雷
    @tminglei
    @graffam use def pgjson = "json" instead of def pgjson = "jsonb" in the CustomPostgresDriver, to tell slick-pg that you want use json string instead of json binary.
    涂名雷
    @tminglei
    @virusdave replied to you in the issue.
    Hi All, sorry for the late. I can't receive the notifications for a long time because of the GFW blocking.
    Dave Nicponski
    @virusdave
    oh man! sorry to hear that tminglei (both the issue response, and GFW blocking)
    i've begun pouring over the slick 3.1.1 AST implementation to see if i can help with the "get slick to structure the UNNEST into the FROM" part
    i think this might be possible with some cleverness, but it requires WAY more knowledge of slick AST than i currently have (but i'm trying to learn now!)
    QmQvl
    @QmQvl
    is there a slick-pg_date2 build for scala 2.12?
    Gleb Alexeyev
    @alexeevg
    Hi! What is the correct way to upsert a bunch of rows into Postgres with Slick?
    Is the accepted answer (TLDR: use JDBC with batch statements directly) still correct? http://stackoverflow.com/questions/35001493/slick-3-0-bulk-insert-or-update
    Gleb Alexeyev
    @alexeevg
    @tminglei
    kusamakura
    @kusamakura
    Hi guys! First, thanks @tminglei for your work in maintaining this library!
    I just have a quick question – what's the best way to create a tstzrange from two Rep[OffsetDateTime] values? Been trying my luck, but so far it seems that raw SQL is the only way.
    Mateusz Górski
    @goral09
    Hello :) I am using slick-pg with circe support and I the JSONs that are persisted in postgres have all special characters escaped ( ie \"key\" : \"value\" ) which makes it impossible to query with postgres' JSON DSL support
    nafg
    @nafg
    @goral09 I doubt if I could help but it would be a good idea to share a self-contained snippet that reproduces it (even if not runnable)
    Nikolai Tatarinov
    @rockjam
    @tminglei hi. when do you expect to release next version of slick-pg?
    Maxim Karpov
    @makkarpov

    When I'm trying to use slick-pg driver (https://pastebin.com/Z3XeXVSJ; as you can see: there is nothing special with it), I get AbstractMethodError on Scala 2.12.2:

    java.lang.AbstractMethodError: Method ru/makkarpov/play/database/DatabaseProfile$MyAPI$.slick$basic$BasicProfile$API$_setter_$Database_$eq(Ljava/lang/Object;)V is abstract

    I'm suppose that this is a compiler bug, but I wondered that Googling for this error shows literally nothing.

    Guy Jarvis
    @buddhabuddy
    Is it possible to toTsVector a whole json column?
    rather than just by key?
    nafg
    @nafg
    Is it possible there was some build issue? For some reason 0.15.3 with scala 2.12 is giving me an AbstractMethodError
    nafg
    @nafg
    @tminglei ?
    nafg
    @nafg
    import $ivy.`com.github.tminglei::slick-pg:0.15.3` 
    new com.github.tminglei.slickpg.ExPostgresProfile { new API {} }
    crashes in ammonite on 2.12 with AME
    玩具羊
    @ToyYang
    Hi guys, I have a question about codegen: bytea -> Array[Byte], what about bytea[]? still Array[Byte]?
    similar question: tminglei/slick-pg#177
    Assen Kolov
    @kolov
    @makkarpov @nafg Is more known about this problem? I get the same error with Scala 2.12 and slick-pg 0.15.3
    Maxim Karpov
    @makkarpov
    @kolov No, I just downgraded to Scala 2.11. It seems to be bug inside Scala compiler.
    nafg
    @nafg
    @kolov sorry for not sharing here, I filed a ticket on scalac on github and they posted a workaround
    scala/bug#10477
    Assen Kolov
    @kolov
    That's great, thank a lot!
    adilkurniaramdan
    @adilkurniaramdan
    hi I am using play-slick 3.0, slick-pg 0.15.4 and I followed the instruction from github and example, but I got following error when I performed query "Caused by: java.lang.ClassCastException: slick.jdbc.PostgresProfile$ cannot be cast to utils.H2hPostgresDriver"
    • and scala 2.12.2
    @tminglei can u help me ? thanks
    Niels Pedersen
    @nielspedersen
    Hi! I’m trying to add slick-pg to my project. Am following the README, but I get stuck on (s) => utils.SimpleArrayUtils.fromString[JsValue](Json.parse(_))(s).orNull,, since Json is not a value. If I use spray-json, should I just use parseJson instead?
    Niels Pedersen
    @nielspedersen
    Scratch that actually. parseJson doesn’t seem to work
    Niels Pedersen
    @nielspedersen
    Scratch that scratching… works with parseJson!
    Jose Martinez
    @callado4
    hi - is there a way to do a filter on if a json attribute is not null? in sql something like select json ->> 'someId' from jsonTable where (json ->> 'someId') is not null