Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 18 19:44

    mergify[bot] on master

    Update scalameta to 4.5.7 Merge pull request #196 from sc… (compare)

  • May 18 19:44
    mergify[bot] closed #196
  • May 18 19:42
    scala-steward opened #196
  • May 05 16:34

    mergify[bot] on master

    Update scalameta to 4.5.6 Merge pull request #195 from sc… (compare)

  • May 05 16:34
    mergify[bot] closed #195
  • May 05 16:32
    scala-steward opened #195
  • Apr 30 16:46

    mergify[bot] on master

    Update scalameta to 4.5.5 Merge pull request #194 from sc… (compare)

  • Apr 30 16:46
    mergify[bot] closed #194
  • Apr 30 16:44
    scala-steward opened #194
  • Apr 25 04:36

    mergify[bot] on master

    Update scalatest to 3.2.12 Merge pull request #193 from sc… (compare)

  • Apr 25 04:36
    mergify[bot] closed #193
  • Apr 25 04:33
    scala-steward opened #193
  • Apr 15 20:35

    mergify[bot] on master

    Update scalameta to 4.5.4 Merge pull request #192 from sc… (compare)

  • Apr 15 20:35
    mergify[bot] closed #192
  • Apr 15 20:33
    scala-steward opened #192
  • Apr 09 16:34

    mergify[bot] on master

    Update h2 to 2.1.212 Merge pull request #191 from sc… (compare)

  • Apr 09 16:34
    mergify[bot] closed #191
  • Apr 09 16:31
    scala-steward opened #191
  • Apr 06 22:46

    mergify[bot] on master

    Update scalameta to 4.5.3 Merge pull request #190 from sc… (compare)

  • Apr 06 22:46
    mergify[bot] closed #190
Peter Hancox
@phancox
If you haven't used this code with dynamic database selection before, then I'll try and make it work myself.
nafg
@nafg
@phancox if you show me a scastie with DatabaseConfig.forConfig not working, maybe I can help
Peter Hancox
@phancox
Not that proficient with the scastie given I'm scattered across multiple modules. Thhis one shoes the module where I do the database setup http://scastie.org/11255
I'll amend it for the change we just discussed and try and add the entity class in
nafg
@nafg
First of all, change the dependency to slick-additions
0.4.0-RC2 should work
Peter Hancox
@phancox
http://scastie.org/11261 sorry didn't know the package name
Peter Hancox
@phancox
Any ideas?
nafg
@nafg
http://scastie.org/11262 fixes the organization name
Oh I have to add the resolver
it's on bintray (jcenter)
Peter Hancox
@phancox
Guess it needs imports? In my code I've just copied your two scala files into my package
nafg
@nafg
Need an import
Compiles fine
ouch ;)
For the same price you could have looked up the organization setting in build.sbt...
Peter Hancox
@phancox
Looks good, thanks.
My problem wasn't the imports but I think I might have screwed up the val profile
My actual code is a bit more complicated, you have the simplified version.
One more thing ....
In my test code, inserts appear to be happening twice. noticed it when the unique index was violated.
However, this doesn't seem to be happening when I run your test case. So just wondering if you've seen something similar before?
Peter Hancox
@phancox
This was my problem:
val profile = if (dbmsName == "PostgreSQL") PostgresDriver else dc.driver
I override the driver for PostgreSQL to drop the identifier quotes. This is why making the change to forConfig[....] threw errors in my code here. I'll still have to take care of this issue but should be much simpler.
nafg
@nafg
so instead of PostgresDriver use MyPostgresDriver where
object MyPostgresDriver extends PostgresDriver with KeyedTableComponent
then the LUB will include KeyedTableComponent
Peter Hancox
@phancox
yep, pretty straight forward. Presume the double insert doesn't ring any bells?
nafg
@nafg
WDYM?
What double insert?
Peter Hancox
@phancox
My test suite threw a uniqueness violation when I inserted a single record. Removed the constraint and it is in fact adding two records for a single insert. Running your test suite doesn't seem to have any problem. So just wondering if you had any ideas?
nafg
@nafg
No, can you provide code that demonstrates the issue?
Peter Hancox
@phancox
Don't worry about it for the moment, I'll have a bit more of a dig since your code unaltered doesn't appear to have an issue.
Many thanks for all your help tonight. I've spent over a week trying out various libraries and approaches for persistence in the Scala world and this library is the most promising so far.
Peter Hancox
@phancox
@nafg Actually that didn't work. Compiles OK but throws run-time exception as it is expecting the internal slick drivers to extend KeyedTableComponent. Will let you know if I'm able to figure it out.
Peter Hancox
@phancox
Gave up and took the easy option; hardcoding just the databases I need
val profile = dbmsName match { case "PostgreSQL" => PostgresDriver case "H2" => new slick.driver.H2Driver with KeyedTableComponent case _ => new JdbcProfile with KeyedTableComponent }
val profile = dbmsName match { case "PostgreSQL" => PostgresDriver case "H2" => new slick.driver.H2Driver with KeyedTableComponent case _ => new JdbcProfile with KeyedTableComponent }
val profile = dbmsName match { case "PostgreSQL" => PostgresDriver case "H2" => new slick.driver.H2Driver with KeyedTableComponent case _ => new JdbcProfile with KeyedTableComponent }
val profile = dbmsName match { case "PostgreSQL" => PostgresDriver case "H2" => new slick.driver.H2Driver with KeyedTableComponent case _ => new JdbcProfile with KeyedTableComponent }
Peter Hancox
@phancox
OK I give up, just cannot get the formatting to hold using triple back-tick and shift-Enter for line breaks !
Peter Hancox
@phancox
@nafg Still trying to figure out the issue with inserts occurring twice. I've put together http://scastie.org/11285 which should demonstrate the issue but I can't get the scastie to run. Was intermittently complaining about issues finding the slick-additions jar but now just seems to hang.
I suspect the issue occurs when inserting a table that doesn't have relations to another table. The Scala is a bit above my level so it's taking a while to debug. The code I'm looking at is in KeyedTableComponent.insert where it has specific code for handling child lookups.
nafg
@nafg
@phancox any idea why it's not resolving?
Weird, I took out the explicit slick dependency (it should be pulled in transitively anyway), now it got past resolving and it has compile errors:
@phancox
Mmm, fixed those http://scastie.org/11295
and get
Caused by: java.lang.SecurityException: ("java.lang.RuntimePermission" "accessClassInPackage.sun.misc")