pjfanning commented on code in PR #194:
URL:
https://github.com/apache/pekko-persistence-r2dbc/pull/194#discussion_r2161531660
##########
core/src/main/scala/org/apache/pekko/persistence/r2dbc/R2dbcSettings.scala:
##########
@@ -16,107 +16,219 @@ package org.apache.pekko.persistence.r2dbc
import java.util.Locale
import scala.concurrent.duration._
-
import org.apache.pekko
import pekko.annotation.InternalApi
import pekko.annotation.InternalStableApi
+import pekko.util.Helpers.toRootLowerCase
import pekko.util.JavaDurationConverters._
import com.typesafe.config.Config
-import pekko.util.Helpers.toRootLowerCase
/**
* INTERNAL API
*/
@InternalStableApi
-object R2dbcSettings {
- def apply(config: Config): R2dbcSettings =
- new R2dbcSettings(config)
+sealed trait Dialect
+
+/**
+ * INTERNAL API
+ */
+@InternalStableApi
+object Dialect {
+ case object Postgres extends Dialect
+ case object Yugabyte extends Dialect
+
+ /** @since 1.1.0 */
+ case object MySQL extends Dialect
+
+ /** @since 1.1.0 */
+ def fromString(value: String): Dialect = {
+ toRootLowerCase(value) match {
+ case "yugabyte" => Dialect.Yugabyte
+ case "postgres" => Dialect.Postgres
+ case "mysql" => Dialect.MySQL
+ case other =>
+ throw new IllegalArgumentException(
+ s"Unknown dialect [$other]. Supported dialects are [yugabyte,
postgres, mysql].")
+ }
+ }
}
/**
* INTERNAL API
*/
@InternalStableApi
-final class R2dbcSettings(config: Config) {
- val schema: Option[String] =
Option(config.getString("schema")).filterNot(_.trim.isEmpty)
+final class JournalSettings(val config: Config) extends ConnectionSettings
with UseConnnectionFactory with BufferSize
Review Comment:
I prefer to keep the old name but if we insist on renaming it, can you
change the .scala filename to match?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]