Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Richard Dallaway
    @utkarshdeep maybe and a where clause to omit null columns? Something like .filter(_.column.isDefined) ?
    Richard Dallaway
    @gomeplus you can access the connection inside a SimpleDBIO (see, e.g., JDBC interop). Not sure if from there you can get to apply the settings you need. Failing that, the next place I'd look is on the Database object, but if you're avoiding the JDBC URL that's maybe not a route that will help.
    Ahmet Yavuz Demir
    Hello folks, I have a problem that I couldn't solved
    I have a case class A where one of its fields is also Sequence of case class B
    when I try to define the table of this case class A it gives me error on "No implicit arguments of Type[Type[Seq[B]]]"
    What should I do now? :(
    André Schmidt
    hello. On lagom project I create a postgres readside. But with using a composited key on each new run (tables already built) I get always a psql exception with relation already exists. My kes looks like this def idxKey = index("article_number_fulfiller_idx",(completeArticleNumber,fulfillerVendorNumber),unique = true) is their any solution for this exception?
    Justin Pihony
    :point_up: June 21, 2020 12:06 AM If nobody responds over the weekend I'll just go ahead and create an issue - please let me know if this was intentional
    Tuomas Kinnunen
    Hi, what is the best way to create a Table schema with variable typed column? My software needs to create new tables with different types dynamically during runtime
    My current implementation just uses a String, but I need to use integer and float types to optimize space usage
    Roberto Leibman
    What does this mean?
    Caused by: slick.SlickException: Cannot use node Filter s2 for inserting data
              .filter(_.userId === userWallet.userId).insertOrUpdate(
    Where the table is:
      class UserWalletTable(_tableTag: Tag) extends profile.api.Table[UserWalletRow](_tableTag, Some("chuti"), "userWallet") {
        def *  = (userId, amount) <> (UserWalletRow.tupled, UserWalletRow.unapply)
        val userId: Rep[UserId] = column[UserId]("userId", O.PrimaryKey)
        val amount: Rep[BigDecimal] = column[BigDecimal]("amount")
    Tuomas Kinnunen
    @rleibman It says that you cannot use .filter with .insertOrUpdate. I think you first need to run that select query to get a result with the primary key and then run insertOrUpdate with value having that primary key if it existed.
    Tuomas Kinnunen
    actually you already know the userId so you don't need to do a select query, just run insertOrUpdate without the filter
    Hi guys, does anything have any guides or reading material where I can see how and what the best practices are to unit test Slick DB operations?
    Tuomas Kinnunen
    Maybe try to search for other projects on github and look at how others have done tests. I have just done sequential tests which create the tables and inserts some test data to an in-memory database.
    Does anyone know how ProvenShape works? I'm trying to create a table with type parameter...
    Tuomas Kinnunen
    ok, got it working, forgot the type parameter from apply and unapply and marked it as T: BaseTypedType
    Henry Story
    Is it possible with slick to produce MySQL INSERT statements without a JDBC connection? I want to write it to a file for later insertion.
    Hi, we've found CVE in slick 3.3.2, but it seems it's fixed already in the master, wander when new version will be published. CVE: {
    "summary": "HikariCP Connection.isClosed() Function TCP Traffic Handling Unspecified Remote Issue",
    "severity": "High",
    "components": [
    "fixed_versions": [
    Antoine Doeraene
    is it possible to build a Query object of some sort that would constructed by "raw sql"? Specifically, I would like to have a query that returns numbers from 1 to n, and be able to make the cartesian product with some other table.
    Do we have any doc for the new Table class in 3.3.2?
    What new Table class?
    Stefan Zeiger
    If anyone wants to try Slick on Dotty, my port to 0.25.0-RC2 is ready and passes all tests (in the main test suite; actually getting to a full distribution build with scaladocs, reactive streams tests, etc. will probably be a bigger issue): - This is based on the sbt 1.3 port draft PR by @alexFrankfurt (slick/slick#2106). Almost everything from the current master branch is still there (tsql being a notable exception, but it could probably be ported to TASTy macros) and only minor changes are required in user code (some additional type annotations).
    @szeiger do you plan to work on Slick more in the future, besides porting it to dotty?
    Stefan Zeiger
    Not sure. I'm starting a new job on August 10th which will greatly reduce my capacity for side projects. I'm mainly interested in trying a completely new API for Dotty that can replace the lifted embedding so I needed to make the execution engine and compiler work. Porting all of it allowed me to gather some more experience with Dotty's metaprogramming (for the 2 macros) and run the tests.
    Stefan Zeiger
    I've created a draft PR for further discussion: slick/slick#2123
    well, good luck on your new job, and I'm certainly relieved that porting to dotty is being tackled
    I wish the codebase were easier for newcomers to contribute to

    Hi! I'm getting the following compilation warning about the * method when migrating schema descriptions to Scala 2.13

    [warn] /Users/foo/Foo.scala:1:2: multiarg infix syntax looks like a tuple and will be deprecated
    [warn]     def * = (id, field1, field2) <> ((Bar.apply _).tupled, Bar.unapply)
    [warn]                                                                                           ^

    I guess the fix is just as follows:

    def * = (id, field1, field2).<>((Bar.apply _).tupled, Bar.unapply)

    Should the docs be updated to cover also Scala 2.13?

    Saif Addin
    Hello All, I am stuck trying to find a good way for Tests to use H2 and for deployment to use MySql
    Want to implement DOA or Cake pattern for flexible JdbcProfile
    But I don't know where from to get the API from RelationalProfile
    Any orientation welcome
    I am just following the docs
    The examples in the docs work mostly for querying, but for schema and table creation, I am not sure how to make it flexible for any Profile kind
    profile.api._ does not seem to include everything I need
    Saif Addin
    I think I got it trait Tables[T] extends JdbcProfile#Table[T] { this: ProfileComponent =>
    Saif Addin
    I am stuck in the next step now, since H2 has a Database from h2.engine and the jdbc database is from jdbc.JdbcBackend
    not sure how can I create a Database type that could handle both (the api is the same)
    Is it safe to use the config key all around the application?
    val accessor = new Accessor("mysql")
    so I can call everwhere I need access to the data
    private val db = DatabaseConfig.forConfig(dbConfig).db
    this way I could switch between h2 and mysql without having to force any Database common type which doesn't seem to exist
    Stefan Zeiger
    @corenti13711539_twitter I recommend switching to mapTo for case classes. The current macro generates a fast-path result converter and it's future-proof (mapTo was easy to implement with Dotty macros but unapply no longer works in Dotty)
    @szeiger So, something like this then?
    class FooTable(tag: Tag) extends Table[Bar](tag, "foo") {
      // ...
      def * = (id, field1, field2).mapTo[Bar]
    object Bar {
      def tupled = (Bar.apply _).tupled
    Philipp Dörfler
    Hi! Is there anything other than for using Oracle and MSSQL with Slick 3?
    2 replies
    Jeremiah Malina
    Hi, I'm using the sbt-assembly plugin (version 0.4.10, sbt 1.3.3), and just upgraded from Scala 2.11 to 2.12. When I run my jar in Spark I get java.lang.RuntimeException: java.lang.ClassNotFoundException: slick.jdbc.DatabaseUrlDataSource though when running tests locally I have no issue. When extracting my jar, slick is there along with the .class files I would expect. Anyone run into this kind of issue?
    1 reply