Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Murphy Randle
    @mrmurphy
    in this case foo
    Gregg Hernandez
    @gregghz
    what is table? you might be subject to an sql syntax error with that usage
    Murphy Randle
    @mrmurphy
    the strange behavior I'm seeing is that foo will sometimes be deleted, and sometimes it will remain while only its content is deleted
    it's nondeterministic
    oh interesting, it's a custom table
    I haven't run into any errors so far
    Gregg Hernandez
    @gregghz
    Hmm, okay. Usually interpolating table names is a mistake. It will get written out as delete from “management” where …. Those quotes usually are a syntax error, that’s why I brought it up
    anyway, your issue: what do you mean by “only its content is deleted”?
    Murphy Randle
    @mrmurphy
    that makes sense. I'm able to avoid the quoting by calling .toSql on the table name string
    Gregg Hernandez
    @gregghz
    :thumbsup: yeah, .toSql was what I was going to suggest, glad that’s working okay
    Murphy Randle
    @mrmurphy
    yeah, that's what's strange, usually all of the columns on the row will be set to NULL
    and the whole row will remain
    but sometimes the row will be removed
    Gregg Hernandez
    @gregghz
    interesting …. you’re using mysql? which driver? I’d make sure whatever sql driver you’re using for your DB is up to date
    Murphy Randle
    @mrmurphy
    I've checked that it's not just my client caching data by loading up psql
    Using postgres, just started this project last week, so it's the latest driver from maven central
    libraryDependencies += "org.postgresql" % "postgresql" % "42.2.2.jre7"
    libraryDependencies += "com.lucidchart" %% "relate" % "2.0.1"
    I think?
    Gregg Hernandez
    @gregghz
    hmm, I’m not sure what’s going on there. What’s the full code that runs the sql? are you calling .update() or execute()? or what?
    Murphy Randle
    @mrmurphy
          val delete = sql"delete from ${bucket.toSql} where key in ($deleteKeys);"
          println(s"DEBUG: ${delete} $deleteKeys")
          delete.execute
    and. usually if there's a sql error an error will be thrown
    Gregg Hernandez
    @gregghz
    right, you should get exceptions from the driver
    Murphy Randle
    @mrmurphy
    does Relate do any kind of query manipulation?
    or is this for sure the raw query that gets sent to the server?
    Gregg Hernandez
    @gregghz
    it does not. It’s pretty pure in terms of not messing with writes like this (it sometimes tries to be smart about reading data)
    Murphy Randle
    @mrmurphy
    I wish I could somehow debug the query and have it print out what the interpolation values will be as well
    :+1:
    Gregg Hernandez
    @gregghz
    yeah, that’s something I’ve wanted in the past too.
    Murphy Randle
    @mrmurphy
    if I copy the query into my client and paste, then write in the key by hand the delete always works as expected
    Gregg Hernandez
    @gregghz
    you could probably get logs from postgres though
    Murphy Randle
    @mrmurphy
    oh good idea
    Gregg Hernandez
    @gregghz
    it would be interesting to see what query is actually running
    you could also write the query using jdbc directly to see if you get the same issue
    if it works with raw jdbc, that points to a relate bug. If it is also sketchy with jdbc then that points to a driver bug
    fwiw, we never really tested relate a lot with postgres. I don’t work at Lucid anymore, but when I was there, a very small subset of sql was written against some redshift stuff (which is approximately Postgres)
    Murphy Randle
    @mrmurphy
    oh good to know!
    seems like it'd be pretty equal, if it's just passing SQL through to the JDBC driver, right?
    Gregg Hernandez
    @gregghz
    yeah, any issues like this actually still point to the jdbc driver. Amazon provides a unique one for redshift, it’s not the mainline postgres driver
    there are a couple places in relate that assume mysql, unfortunately. But they are pretty rare. I can’t remember the specifics but it was all for reads. I’ve never seen db implementation issues like this related to writes.
    Murphy Randle
    @mrmurphy
    D'OH
    Logs
    are very helpful
    I think my application layer is deleting and then re-inserting
    Gregg Hernandez
    @gregghz
    that’s good news for me :) it means I didn’t write broken code ;)
    Murphy Randle
    @mrmurphy
    Haha :D
    Thanks for the code, BTW @gregghz
    We're Utah neighbors to Lucid
    Gregg Hernandez
    @gregghz
    haha, don’t thank me too much, @pauldraper and @msiebert also did a ton. Incidentally they’re both no longer at Lucid either :D
    Murphy Randle
    @mrmurphy
    and have friends over there, so it feels good to be using a lucid thing
    well that's just how things go!