-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add typo with custom types #426
Conversation
Preview ready at https://add-typo.sssppa.wiringbits.dev
|
Preview ready at https://add-typo.sssppa.wiringbits.dev
|
build.sbt
Outdated
@@ -37,7 +38,7 @@ lazy val commonSettings: Project => Project = { | |||
Wart.IsInstanceOf, | |||
Wart.JavaConversions, | |||
// Wart.JavaSerializable, | |||
Wart.MutableDataStructures, | |||
// Wart.MutableDataStructures, |
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.
We can suppress warts for typo-generated sources, see (https://www.wartremover.org/doc/install-setup.html).
It seems this is the way wartremoverExcluded += baseDirectory.value / "src" / "main" / "scala" / "SomeFile.scala"
@@ -20,4 +21,21 @@ object Email extends WrappedString.Companion[Email] { | |||
} | |||
|
|||
override def trusted(string: String): Email = new Email(string) | |||
|
|||
implicit val emailColumn: Column[Email] = Column.nonNull[Email] { (value, _) => |
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.
If I understand correctly, the reason to do this is because Typo picks these models and expects the Column
definition to be available.
Let's try adding all these definitions into the typo project, we can use the scala-cli script to import these into each generated source.
Preview ready at https://add-typo.sssppa.wiringbits.dev
|
Preview ready at https://add-typo.sssppa.wiringbits.dev
|
1 similar comment
Preview ready at https://add-typo.sssppa.wiringbits.dev
|
@@ -19,5 +21,7 @@ object Email extends WrappedString.Companion[Email] { | |||
} | |||
} | |||
|
|||
override def trusted(string: String): Email = new Email(string) | |||
implicit override def trusted(string: String): Email = new Email(string) |
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.
Please avoid implicit conversions
override def trusted(string: String): Email = new Email(string) | ||
implicit override def trusted(string: String): Email = new Email(string) | ||
|
||
implicit val sqlType: String = "CITEXT" |
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.
This doesn't make much sense to me, can we write it somewhere else? the typo layer would be ideal
See #424 |
Added SQL DSL files from Typo to replace our DAOs
Typo docs https://oyvindberg.github.io/typo/docs/