Added custom sqlite types support#1741
Conversation
| get() = "org.sqlite.JDBC" | ||
|
|
||
| override fun getExpectedJdbcType(tableColumnMetadata: TableColumnMetadata): KType = | ||
| customTypesMap[tableColumnMetadata.sqlTypeName] ?: super.getExpectedJdbcType(tableColumnMetadata) |
There was a problem hiding this comment.
I'm not sure if sqlTypeName is enough to differentiate the right type.
Also, take nullability into account.
There was a problem hiding this comment.
For now, I believe sqlTypeName is OK.
However, we should improve this mechanism in future. This will require us to research use cases in depth.
|
Requires #1735 |
|
The problem is clear, your proposal is also promisable.
|
|
| DriverManager.getConnection(dbConfig.url, dbConfig.user, dbConfig.password) | ||
| } | ||
|
|
||
| public companion object { |
There was a problem hiding this comment.
A fun trick I just learned. If you make Sqlite open, you can make the companion object be the default itself, like companion object : Sqlite() {}
This means users can specify both Sqlite and Sqlite.withCustomTypes(customTypes). Not sure if you like that :)
There was a problem hiding this comment.
Oh, seems great!
There was a problem hiding this comment.
But I am not sure if this is actually good here, need a research of use-cases.
Closes #964