Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Flavio W. Brasil
    @fwbrasil
    @rinmalavi it is possible only to read outside of transactional
    but it won’t provide any consistency guarantees
    Marin Vila
    @rinmalavi
    Guess that is actually good, but will introduce some code duplication,
    thanks!
    Marin Vila
    @rinmalavi
    do I need any special import in order to use .col method?
    Marin Vila
    @rinmalavi
    I am trying to make https://github.com/fwbrasil/activate/blob/master/activate-docs/query.md#slick-queries work. Get 'col is not member of String' Error.
    I see its in SlickQueryContext trait and i have it imported with ActivateContext, but i can't call it on id property.
    Ryan Proud
    @spry-rproud
    import context.driver.simple_
    Marin Vila
    @rinmalavi
    thanks, that worked :+1:, tho idea is complaining about execute
    now, however, I have RequiredTransactionException
    this is what i am trying to do:
    case class A(a: String, b: String)extends  Entity
    case class B(a: A, c: String) extends  Entity
    
    val a =(for {
      a <- SlickQuery[A]
      b <- SlickQuery[B] if b.a.col === a.col
    } yield (b.col)).execute
    Ryan Proud
    @spry-rproud
    wrap in transactional {}
    Marin Vila
    @rinmalavi
    oh, ofc, thought they dont need those
    Marin Vila
    @rinmalavi
    java.lang.InternalError: Malformed class name :sparkles:
    works nicely tho, except the part the idea doesn't compile
    Marin Vila
    @rinmalavi

    I have one more, hope i am not disturbing too much :-)
    I need to find an average over field for a certain detail
    Basically i want to do this

      case class A(a: String, b: String)extends  Entity
      case class B(a: A, c: String, f: Int) extends  Entity
    
      val a = (for {
        a <- SlickQuery[A].rightJoin(SlickQuery[B]).on(_.col === _.a.col)
      } yield a).groupBy(_._2.a.col).map { case (n, g) => (n, g.map {_._2.f}.avg) }.execute

    Tried several combinations usually get:
    Trying to reassign node type -- nodeTyped() may only be called on freshly constructed nodes

    ....
    (SlickQueryContext.scala:137)
    [error] net.fwbrasil.activate.slick.SlickQueryContext$QueryRun
    KaTeX parse error: Unexpected character: '$' at position 7: anonfun̲$execute$1.app: anonfun$execute$1.apply(SlickQueryContext.scala:137)
    [error] net.fwbrasil.activate.slick.SlickQueryContext$QueryRun
    anonfun$execute$1.apply(SlickQueryContext.scala:136)
    [error] net.fwbrasil.activate.slick.SlickQueryContext$$anon$1.withSession(SlickQueryContext.scala:89)
    [error] net.fwbrasil.activate.slick.SlickQueryContext$QueryRun.execute(SlickQueryContext.scala:135)
    Ryan Proud
    @spry-rproud

    @fwbrasil Is there any way to provide hints to ensure that statements generated in the transaction are executed in a specific order? We're running into an issue, where our entity design looks cyclical, but the actual data itself is not. It appears that this is causing FK constraint errors. ie.

    class Foo(var name: String, var bar1: Bar, var bar2: Bar) extends Entity
    class Bar(var name: String, var foo: Foo) extends Entity
    
    transactional {
        val bar1 = new Bar("bar1", null)
        val bar2 = new Bar("bar2", null)
    
        val foo = new Foo("foo", bar1, bar2)
    }

    This transaction is occasionally (it does appear to be random) failing because the ids for bar1 and bar2 do not exist yet in the database. Any of instance of Bar that is referenced by Foo should always have a null foo reference.

    qdx
    @qdx
    Just trying out Activate, got into a little problem querying datetime from mysql database, here's the code:
    ```
    class Ratings(var name: String,
                  var f_rating_id: Int,
                  var deleted: Boolean,
                  var created_at: Option[DateTime],
                  var updated_at: Option[Date],
                  var h_rating_id: Int) extends Entity
    
    object ExampleMain extends App {
      transactional {
        val ratings = select[Ratings] where (_.id :== 4)
        println(ratings.map{r => s"${r.name}, ${r.created_at.get}, ${r.updated_at.get}"})
      }
    }
    The out put I get is:
    List(TV-Y,1969-12-31T16:00:02.009-08:00,4,Wed Dec 31 16:00:02 PST 1969)
    where the date doesn't seem to be right, they are not from year 1969 in the database.
    Can anyone help?
    Clayton Silva
    @claytonsilva
    @fwbrasil i want to add redshift support on activate, but i broke the build on polyglot teste :( , do you can help me?
    Pawel
    @odwrotnie
    hi!
    Flavio W. Brasil
    @fwbrasil
    hi!
    @claytonsilva focus on having the tests for redshift passing and create a pull request, i can help fixing the other tests
    Ryan Proud
    @spry-rproud
    @fwbrasil Should SlickQuery work with custom normalize functions? It's using incorrect relation names when using underscoreSeparated.
    Flavio W. Brasil
    @fwbrasil
    @spry-rproud I don’t remember the implementation, but it should
    it is probably a bug
    Ryan Proud
    @spry-rproud
    @fwbrasil Any reason why the following wouldn't work? It runs without error but "bar" gets set to foo.id instead of BAR-${foo.id}.
    customScript {
      update {
        (foo: Foo) => where() set (foo.bar := s"BAR-${foo.id}")
      }
    }
    Flavio W. Brasil
    @fwbrasil
    @spry-rproud i can't see why it wouldn’t work
    Clayton Silva
    @claytonsilva
    hi everyone
    someone need to create "fat-jar" to run activate task ?
    i get this error ava.lang.IllegalArgumentException: Invalid entity class class net.fwbrasil.activate.migration.StorageVersion.
    java.lang.IllegalArgumentException: Invalid entity class class net.fwbrasil.activate.migration.StorageVersion.
    Pawel
    @odwrotnie
    how do you count the results in query?
    Smirnov Ivan
    @StopKran
    Hi there. Does anyone use Activate in production, and what are your impressions of it? Activate looks very good, but for me it is little scared to use it. What about perspectives of the project? And what about documentation? Site tells, that last release is 1.6, but i found 1.7 in maven repository http://repo1.maven.org/maven2/net/fwbrasil/activate-core_2.11/1.7/ - what is it? Should it works with scala 2.11.2 and play framework 2.3.8?
    Ryan Proud
    @spry-rproud
    @fwbrasil Just checking in on the status of activate. Is this going to see any more active development?
    Flavio W. Brasil
    @fwbrasil
    hi @spry-rproud, I’m planning to work on a 2.0 release still this year
    is there something blocking you currently?
    Ryan Proud
    @spry-rproud
    Nothing, currently blocking. Just a few work arounds that are not ideal that we would like to iron out.
    Flavio W. Brasil
    @fwbrasil
    i see
    I’m working on a new query lib to integrate with Activate
    the built-in query mecheanism is limited
    and I had too many problems using Slick queries
    @spry-rproud what query mechanism do you use?
    activate queries or slick?
    Ryan Proud
    @spry-rproud
    Once you start to map out 2.0, let me know and I'll see if I can help out at all. Ok, will there be any support for postgresql json? We're using a mixture of activate queries and slick queries with slick-pg tacked on.
    Flavio W. Brasil
    @fwbrasil
    will do, my plan is release quill mid-september and start working on 2.0
    it’ll be nice to have your input
    Ryan Proud
    @spry-rproud
    Ok, sounds good.