-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support scala3 with slick #167
Changes from 4 commits
bef8153
f9922d6
7cacaa3
2fd70dd
3a1de3b
aa6862f
997d187
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,29 +35,32 @@ import pekko.projection.jdbc.internal.MySQLDialect | |
import pekko.projection.jdbc.internal.OracleDialect | ||
import pekko.projection.jdbc.internal.PostgresDialect | ||
import pekko.util.Helpers.toRootLowerCase | ||
import slick.basic.DatabaseConfig | ||
import slick.jdbc.JdbcProfile | ||
|
||
/** | ||
* INTERNAL API | ||
*/ | ||
@InternalApi private[projection] class SlickOffsetStore[P <: JdbcProfile]( | ||
system: ActorSystem[_], | ||
val db: P#Backend#Database, | ||
val profile: P, | ||
val databaseConfig: DatabaseConfig[P], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure it was a good idea to directly use config rather than db instance and profile. Are these harmful for tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That should be fine, just lost some typesafety There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
These classes are internal classes. I don't see it being a problem changing them. The constructor was like this before but was changed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, I think this change is fine. |
||
slickSettings: SlickSettings, | ||
clock: Clock) { | ||
|
||
def this(system: ActorSystem[_], databaseConfig: DatabaseConfig[P], slickSettings: SlickSettings) = | ||
this(system, databaseConfig, slickSettings, Clock.systemUTC()) | ||
|
||
import OffsetSerialization.MultipleOffsets | ||
import OffsetSerialization.SingleOffset | ||
import profile.api._ | ||
import databaseConfig.profile.api._ | ||
|
||
def this(system: ActorSystem[_], db: P#Backend#Database, profile: P, slickSettings: SlickSettings) = | ||
this(system, db, profile, slickSettings, Clock.systemUTC()) | ||
private val db = databaseConfig.db | ||
|
||
val (dialect, useLowerCase): (Dialect, Boolean) = { | ||
|
||
val useLowerCase = slickSettings.useLowerCase | ||
|
||
profile match { | ||
databaseConfig.profile match { | ||
case _: slick.jdbc.H2Profile => | ||
( | ||
H2Dialect(slickSettings.schema, slickSettings.table, slickSettings.managementTable, useLowerCase), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is an example test class in the jdocs package that Scala 3 won't allow to access this package private class