Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ryan Stradling
    @rstradling
    @nafg Parameterized queries/Prepared Statements with parameters/bind parameters. I am seeing the SQL spit out as SELECT ... FROM TABLE where id = 3 vs SELECT ... FROM TABLE where id = ? unless I compile the query or use an interpolated string.
    Olav Grøndal
    @ogroendal
    I am running into a what I suspect is a bug in Slick. I have a groupBy and then a map where i use avg, whick will result in a runtime error, with the message "slick.SlickTreeException: Cannot convert node to SQL Comprehension". If I just change that to using the .length method then the code works in runtime.
    I am not sure if it could be related to this issue: slick/slick#1355
    I am using Slick 3.3.3
    Takafumi Iju
    @ijufumi

    Hi,

    I'm developing a scala web app using Slick.
    However, I face a problem that I can't resolve.
    I have no idea what the cause is.

    16:21:11 % sbt clean run
    [info] welcome to sbt 1.6.2 (Eclipse Adoptium Java 17.0.4)
    [info] loading settings for project openreports_scala-build from plugins.sbt ...
    [info] loading project definition from /Users/ijufumi/workspaces/ijufumi/production/openreports_scala/project
    [info] loading settings for project root from build.sbt ...
    [info] set current project to Open Report API (in build file:/Users/ijufumi/workspaces/ijufumi/production/openreports_scala/)
    [success] Total time: 0 s, completed Aug 14, 2022, 4:30:47 PM
    [info] compiling 34 Scala sources to /Users/ijufumi/workspaces/ijufumi/production/openreports_scala/target/scala-2.13/classes ...
    [error] /Users/ijufumi/workspaces/ijufumi/production/openreports_scala/src/main/scala/jp/ijufumi/openreports/entities/Member.scala:47:7: value <> is not a member of (slick.lifted.Rep[Option[Int]], slick.jdbc.PostgresProfile.api.Rep[String], slick.jdbc.PostgresProfile.api.Rep[String], slick.jdbc.PostgresProfile.api.Rep[String], slick.jdbc.PostgresProfile.api.Rep[String], slick.jdbc.PostgresProfile.api.Rep[String], slick.jdbc.PostgresProfile.api.Rep[java.sql.Timestamp], slick.jdbc.PostgresProfile.api.Rep[java.sql.Timestamp], slick.jdbc.PostgresProfile.api.Rep[Long])
    [error] possible cause: maybe a semicolon is missing before `value <>`?
    [error]     ) <> (Member.tupled, Member.unapply)
    [error]       ^
    [error] /Users/ijufumi/workspaces/ijufumi/production/openreports_scala/src/main/scala/jp/ijufumi/openreports/entities/Member.scala:47:33: missing argument list for method unapply in object Member
    [error] Unapplied methods are only converted to functions when a function type is expected.
    [error] You can make this conversion explicit by writing `unapply _` or `unapply(_)` instead of `unapply`.
    [error]     ) <> (Member.tupled, Member.unapply)
    [error]                                 ^
    [error] two errors found
    [error] (Compile / compileIncremental) Compilation failed
    [error] Total time: 3 s, completed Aug 14, 2022, 4:30:49 PM

    My code is here.

    Can someone please help me?

    Thanks

    Naftoli Gugenheim
    @nafg
    @ijufumi the problem is that for <> to work it needs an implicit for Timestamp column type, but it's hitting an ambiguous implicit issue. (Once you solve this, you don't need the explicit (timestampType) on the columns).
    One way to solve it is to exclude the driver's implicit when you import it:
    import slick.jdbc.PostgresProfile.api.{timestampColumnType => _, _}
    Another option is to extend the profile and its API and override timestampColumnType with your implementation
    Also, if you could rename your implicit to that and arrange things so you import it or mix it in in an inner scope, then it might shadow the profile's implicit
    Option 2 is the best if you want this in a few places
    @rstradling I don't know the answer
    Takafumi Iju
    @ijufumi
    @nafg
    I am grateful for your support.
    I could resolve this problem.
    Naftoli Gugenheim
    @nafg
    This message was deleted
    @/all you can join the new #slick channel on the main Scala Discord: https://discord.gg/yQheBhUtAa
    Naftoli Gugenheim
    @nafg
    @/all 3.4.0 is on maven central! I haven't written a proper announcement yet but the generated release notes are at https://github.com/slick/slick/releases/tag/v3.4.0. And remember we're on Discord now https://discord.gg/yQheBhUtAa
    gpathakxandr
    @gpathakxandr
    hi I am trying to use the slick codegenerator against a locally running database and i see that MySQLProfile.defaultTables does not return any tables at all.
    my config is the following val url = "jdbc:mysql://127.0.0.1:3306/test" val user = "root" val password = "redacted" val jdbcDriver = "com.mysql.cj.jdbc.Driver"
    any idea what i could be missing here.
    i create the database using val db = MySQLProfile.api.Database.forURL(url, user = user, password = password, driver = jdbcDriver)
    the logs do not show any statement being run
    MySQLProfile.defaultTables seems to be broken? or im using it wrong.
    slick version is 3.2.3
    benthecarman
    @benthecarman
    Is there known support with sqlite cypher? Trying to use https://github.com/Willena/sqlite-jdbc-crypt but getting issues, not sure if it slick giving me issues or if flyway is
    benthecarman
    @benthecarman
    Seems it is a flyway issue
    gpathakxandr
    @gpathakxandr
    Naftoli Gugenheim
    @nafg
    @/all if you have an opinion about slick/slick#2542 "slf4j-api update is cumbersome" please comment ASAP
    Upgrade to 3.4.1 now!
    Andy Czerwonka
    @andyczerwonka
    :wave: I'm trying to use the slick DSL to sort by a field from a joined table, it is a foreign key that is mapped. Could someone point me to an example? I can't seem to work it out.
    marmaladesky
    @marmaladesky:matrix.org
    [m]

    andyczerwonka (Andy Czerwonka):
    Could you please show a minimal reproducible example where you have the issue?
    There is nothing special about sorting after joining:

    TableA
      .join { TableB }
      .on { (a, b) => a.b_id === b.id }
      .sortBy { case (_, b) => b.sortColumn }

    But most probably I misunderstood you.

    Naftoli Gugenheim
    @nafg
    @andyczerwonka do you know there's a discord channel now?
    gitexp2050
    @gitexp2050
    How to process millions of records one by one...What is the quickest way ? Basically need to do search always the table which has millions of records...
    gitexp2050
    @gitexp2050

    I have 100 queries to run in a single query and print the result as time taken

    for example,
    select from employee, select from employee_address, select * from sales

    How to combine all the queries and print the time taken with a single query?

    Not programming but in MySQL query, need the report/summary of execution time with one query

    Thanks

    Naftoli Gugenheim
    @nafg
    @gitexp2050 sorry I don't fully understand. Can you open a github discussion with a lot of detail?
    Seeta Ramayya
    @Seetaramayya

    How to retrieve the last update of multiple devices? Multiple (say IOT) devices (each identified with device Id) updates its data continuously. Following groupBy with take not compiling

    FlatMap is compliing but runtime exception is happening. (groupBy followed by map required according to documentation)

    How to get only lastUpdated record of all devices? IMHO Get all the data and do filtering which is not effective / optimal solution (IMHO)

    Any suggestions? Thanks

    case class DeviceData(deviceId: UUID, updatedAt: Instant, ...)
    data.groupBy(_.deviceId).map(_._2.sortBy(_.updatedAt.desc).take(1))
    3 replies
    gitexp2050
    @gitexp2050

    I'm new beginner in java and have a assignment to do heap and thread dump analysis and find out the bug and exact root cause..basically a demo to be shown

    Can someone guide me where i can get some samples of Thread and Heap Dump with issues, steps to find the actual issue or root cause in the dumps ?

    Bug identification with thread dump and heap dump which has issues.

    Kwabena Aning
    @kaning
    Hello is there a way to do this in slick
    SELECT S.PCATID, SUM(T.AMOUNT) FROM TRANSACTIONS T LEFT JOIN BILLS ON BILLS.ID = T.BILLID JOIN SECONDARYCATEGORIES S ON (S.ID = T.CATID AND T.BILLID = -1) OR (S.ID = BILLS.CATID AND BILLS.ID = T.BILLID)
    gitexp2050
    @gitexp2050
    can anyone help me with a javascript clarification? please kindly ping me
    Naftoli Gugenheim
    @nafg
    @gitexp2050 what does javascript have to do with Slick? This is a Scala database library
    Windymelt
    @windymelt
    Hi, would it be possible to get a new stable release of Slick?
    I'm waiting for Slick available for HikariCP 5.
    I'm going to bump Java up to 17, so I have to use Hikari 5.
    Thanks!
    gitexp2050
    @gitexp2050
    any notetaking app build using slick? please help me with few links to refer?
    Naftoli Gugenheim
    @nafg
    @windymelt I would like to publish a milestone release after slick/slick#2397 and slick/slick#2612 are merged
    @gitexp2050 why?
    corentin
    @corenti13711539_twitter
    How do I compile update statements with Slick? Any pointers to examples?
    Naftoli Gugenheim
    @nafg
    @corenti13711539_twitter not sure offhand, but if you want to come onto a google meet I can try to figure it out
    otherwise try Discord or github discussions
    gitexp2050
    @gitexp2050
    Which is the best place to store image and server front-end quickly or fastly? Need to display 100 images in front-end
    1. S3
    2. Firebase
    3. DB
    4. Application Server folder webapps/project
    5. Shared folder common to application servers
    6. Folder in the Application Server outside the project (c:\ or d: drives)
    7. How many API calls to be sent to the server ? Each Image Each API call?
    Naftoli Gugenheim
    @nafg
    @gitexp2050 what does that have to do with slick?