Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Flavian Alexandru
    @alexflav23
    That's why the Database construct is created, so everything can be type-checked and driven by case class ADTs
    Jelmer Kuperus
    @jelmerk
    In my case the table is static, i just want multiple instances of it
    table_index_1, table_index_2 etc
    but the fields would all be the same
    but its pretty rough on the eyes
    Jelmer Kuperus
    @jelmerk
    @alexflav23 is this at least somewhat sane ? or is there a better way to accomplish this
    outside of pivoting to something that's better equipped to deal with these sort of requirements
    Flavian Alexandru
    @alexflav23
    I guess that can work
    it’s fairly restrictive versus what phantom does
    But it should get you going for sure @jelmerk
    Phantom does a similar thing behind the scenes, but via a macro
    it does allow for creation query and setting overrides though, which your code won't
    But if the tables don’t need that you should be fine
    Jelmer Kuperus
    @jelmerk
    It does do creation queries
    Because i implement createQueries of that helper trait
    ehsanshah
    @ehsanshah
    how can map field datatype with time in scala phantom driver ?
    Error:(194, 34) Cannot find primitive implementation for class LocalTime
        object duringTime    extends Col[LocalTime]
    ehsanshah
    @ehsanshah
    ???
    ehsanshah
    @ehsanshah
    how can map datatype Time in phantom ?
    Flavian Alexandru
    @alexflav23
    documentation is your friend
    ehsanshah
    @ehsanshah
    @alexflav23 i read this document before you send ,but i can't found any describe about Time Data Type primitive !!! And you can read :(
    Flavian Alexandru
    @alexflav23
    You are meant to implement your own though
    That’s an example of how to implement your own
    ehsanshah
    @ehsanshah
    @alexflav23
    i can't found ! could you write hear how can write only Time primitive ?
    ehsanshah
    @ehsanshah
    @alexflav23 ????
    Krzysiek Ciesielski
    @kciesielski
    Hello, is there anything in progress regarding a build for Scala 2.13?
    Flavian Alexandru
    @alexflav23
    @kciesielski outworkers/phantom#898
    Still some work to do on upgrading collections libray usage
    Krzysiek Ciesielski
    @kciesielski
    i see, thanks
    Wojciech Łukasiewicz
    @wojtuch

    hello everyone! I have a problem with pagination. I can't figure out the proper setup for reading the result in pages.
    after reading the first page:

        select
          .where(_.email eqs email)
          .orderBy(_.timestamp.descending)
          .paginateRecord(_.setFetchSize(numItems))

    when I want to use the returned pagingState to retrieve the next page

        select
          .where(_.email eqs email)
          .orderBy(_.timestamp.descending)
          .paginateRecord(pagingState)

    I get all the remaining records instead of the next page (of size numItems from the first call).

    Trying to add .limit(numItems) after orderBy and before paginateRecord in the second call results in PagingStateException: Paging state mismatch, this means that either the paging state contents were altered, or you're trying to apply it to a different statement.

    Any ideas what I am doing wrong?
    Thanks in advance!

    Wojciech Łukasiewicz
    @wojtuch
    I can't edit my message (maybe I used the limit as I edited it 2-3 times already) so forgive me another post.
    This example (https://github.com/outworkers/phantom/blob/976479391ec8f2bf919e6738dc6243153bf34c8d/phantom-streams/src/test/scala/com/outworkers/phantom/streams/suites/iteratee/IteratorTest.scala#L50) doesn't help as the entire result is read in 2 batches.
    Wojciech Łukasiewicz
    @wojtuch
    I managed to get it to work. For those who experience a similar issue: subsequent calls should set fetchSize and pagingState on the filtering statement:
        select
          .where(_.email eqs email)
          .orderBy(_.timestamp.descending)
          .paginateRecord(_.setPagingState(pagingState).setFetchSize(numItems))
    Flavian Alexandru
    @alexflav23
    Yes
    Sorry for the late reply. @wojtuch that’s the specific method you need to call to get the paging state.
    There are docs as well
    Wojciech Łukasiewicz
    @wojtuch
    I didn't find a specific example of chaining the set... methods in a paginateRecord overload to achieve this and it didn't occur to me immediately :) thanks for the reply!
    Harsh Gupta
    @hardmettle
    Hi @\all I just started exploring phantom and I have hit a block.I wanted to know what resolves this import import com.outworkers.phantom.auto._
    Flavian Alexandru
    @alexflav23
    @hardmettle Auto is a pro feature, we have a subscription version that gets you SLA, support, and some other modules includes auto which helps with automated derivation of encodings.
    We are looking at next year’s roadmap for making some of that public
    Harsh Gupta
    @hardmettle
    @alexflav23 thanks, but as of now if I have to write complicated nested case classes to cassandra without pro then how can I do that ? Please suggest
    Jelmer Kuperus
    @jelmerk

    If I try and add a

    def save(record: JsonClass): Future[ResultSet] = store(record).future() method to

    https://github.com/outworkers/phantom/blob/v2.28.0/phantom-dsl/src/test/scala/com/outworkers/phantom/json/JsonTable.scala#L49

    It won't compile and i get the error no implicit parameters thl

    why does this not work
    Jelmer Kuperus
    @jelmerk
    even the most basic things in this library give cryptic macro errors...
    Jelmer Kuperus
    @jelmerk
    And my next woe .. why does select .function(t => sum(t.count)).aggregate() return Future[Option[Option[Int]]] instead of Future[Option[Int]]
    Flavian Alexandru
    @alexflav23
    @hardmettle Unless you are very comfortable with shapeless or similar things, it’s going to be very hard, hence why we put so much work in a pro product.
    @jelmerk That’s a fair comment, it’s unfortunate that is the case, however that’s not as basic functionality as it seems, sadly.
    Berke SOKHΛN
    @berkesokhan_twitter
    So IIUC, Cassandra UDT support and Monix support is in Pro version. What is the pricing like, I couldn't seem to find a public pricing for Pro subscription?
    Also we had issues with Quill's UDT-in-UDT scenarios. Does phantom-pro support mapping an object for a frozen UDT list of an object which has another frozen UDT collection in?