Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    jargalbaatar
    @gijan
    row.longOption("ID") Oracle 11g MatchError BigDecimal, is Fixed
    Gregg Hernandez
    @gregghz
    Try row.bigDecimal("ID").longValue if you're sure the value fits in a long.
    bigDecimalOption, I mean
    jargalbaatar
    @gijan
    def getLong(value: Option[BigDecimal]):Option[Long] = {
    value match {
    case Some(x) => Some(x.longValue())
    case _ => None
    }
    }
    my ?
    :D
    Gregg Hernandez
    @gregghz
    row.bigDecimalOption("ID").map(_.longValue) will work too. A little less boiler plate.
    jargalbaatar
    @gijan
    thanks.
    row.bigDecimalOptoin("BLA") Invalid Column result None
    Anorm (get("BLA") ?)
    joda DateTime suppoert
    my first Test Anorm vs Relate rows=20 Anorm(29 ms) vs Relate(19 ms)
    jargalbaatar
    @gijan
    method apply in object RowParser is deprecated: Use plain SqlResult => A
    warning
    ruslanasa
    @ruslanasa
    hi everybody, anybody knows about plans to release relate for scala 2.12 ?
    Gregg Hernandez
    @gregghz
    I keep thinking about it. I'll take a glance and see what needs to be done real quick.
    specs2, scalameter and anorm all don't have a scala 2.12 release. In theory this means we should be able to build against 2.12 but not run tests/benchmarks against it.
    @ruslanasa also, sorry for taking so long to reply :(
    Gregg Hernandez
    @gregghz
    while we might be able to do something pretty tricky to get a 2.12 build out now, it's much more likely that we'll have to wait for those projects to update to 2.12
    ruslanasa
    @ruslanasa
    @gregghz thank you for responding!
    ruslanasa
    @ruslanasa
    @gregghz I'll be using 2.11 for now!
    @gregghz I'll be using 2.11 for now.
    Anorm is not available, but we can figure out a way to exclude it.
    Gregg Hernandez
    @gregghz
    Weird. Back in December I think I just changed the scala version to 2.12 and saw what failed to resolve. I'm guessing I needed to bump versions of those projects too.
    Paul Draper
    @pauldraper
    Yeah, that's probably it
    Paul Draper
    @pauldraper
    lucidsoftware/relate#41
    ^ 2.12 upgrade
    Gregg Hernandez
    @gregghz
    Looks great. You should merge it
    Gregg Hernandez
    @gregghz
    Does anyone know of how to generate the API docs?
    Paul Draper
    @pauldraper
    sbt doc:compile I'm guessing Mark copied that to the ghpages branch
    Gregg Hernandez
    @gregghz
    sounds like it. thanks.
    Gregg Hernandez
    @gregghz
    lucidsoftware/relate#43
    this should be ready to merge.
    do we need this anymore?
    nice.
    Mark de Jong
    @Fristi
    Hello
    Anyone here?
    I've got problems with #44 , anyone could be of help?
    Gregg Hernandez
    @gregghz
    Hi @Fristi can you try that again without the .toString() call on the millis?
    Mark de Jong
    @Fristi
    @gregghz It throws the same error

    I also tried this:

      implicit def fromFiniteDuration(state: FiniteDuration): SingleParameter =
        new StringParameter(s"${state.toMinutes} minutes")
    
          val stmt = sql"SELECT session_id, user_uuid, device_uuid FROM sessions WHERE session_id = $sessionId AND AGE(now(), created_at) <= interval $sessionDuration"
          println(s"sql: ${stmt.statementString}")
    
            stmt
            .asList(decoder)
            .headOption

    Which throws

    sql: HikariProxyPreparedStatement@61506193 wrapping SELECT session_id, user_uuid, device_uuid FROM sessions WHERE session_id = '$2a$10$ES/P9qy1TrAuah7dVuZEeehL/oeVJ5Sm/WSFYh0JO4AfL04SjyKg.' AND AGE(now(), created_at) <= interval '5 minutes'
    [ERROR][17:09:20.676][application][C:] -
    
    ! @736ajg8kd - Internal server error, for (POST) [/api/v0.1/user/exchange] ->
    
    play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[PSQLException: ERROR: syntax error at or near "$2"
      Position: 118]]
        at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:280)
        at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:206)
        at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:100)
        at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:99)
        at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:346)
        at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:345)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
        at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:70)
        at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40)
        at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248)
        at scala.concurrent.Promise$class.complete(Promise.scala:55)
        at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153)
        at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
        at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
        at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
        at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:91)
        at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
        at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
        at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
        at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:90)
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:39)
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:415)
        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
    Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "$2"
      Position: 118
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
        at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161)
        at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
        at com.lucidchart.open.relate.NormalStatementPreparer$class.results(StatementPreparer.scala:90)
        at com.lucidchart.open.relate.Sql$$anon$2.results(SqlQuery.scala:285)
        at com.lucidchart.open.relate.StatementPreparer$class.execute(StatementPreparer.scala:20)
        at com.lucidchart.open.relate.Sql$$anon$2.execute(SqlQuery.scala:285)
        at com.lucidchart.open.relate.Sql$class.asList(SqlQuery.scala:441)
        at com.lucidchart.open.relate.interp.InterpolatedQuery.asList(InterpolatedQuery.scala:8)
        at com.next.user.dao.impl.SessionDao$$anonfun$findBySessionId$1.apply(SessionDao.scala:46)
        at com.next.user.dao.impl.SessionDao$$anonfun$findBySessionId$1.apply(SessionDao.scala:41)
        at play.api.db.DefaultDatabase.withConnection(Databases.scala:155)
        at play.api.db.DefaultDatabase.withConnection(Databases.scala:149)
        at com.next.user.dao.impl.SessionDao$$anonfun$DbFuture$1.apply(SessionDao.scala:20)
        at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
        at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
        at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
    Gregg Hernandez
    @gregghz
    thanks, I'm looking into the UUID issue right now. When I get some extra time I'll see what I can do about this one
    Mark de Jong
    @Fristi
    I've tried to run the query printed above SELECT session_id, user_uuid, device_uuid FROM sessions WHERE session_id = '$2a$10$ES/P9qy1TrAuah7dVuZEeehL/oeVJ5Sm/WSFYh0JO4AfL04SjyKg.' AND AGE(now(), created_at) <= interval '5 minutes' in psequel (postgres mac client)
    That works fine
    Gregg Hernandez
    @gregghz
    ok cool. I just pushed a fix for the UUID issue for reading data from a column. But there's a related issue where you can't interpolate UUIDs in postgres: lucidsoftware/relate#47
    here's the fix for reading data: lucidsoftware/relate#46
    Mark de Jong
    @Fristi
    Thanks :-)