From 63aadd186e8029bdee61c130b47706725ec1e624 Mon Sep 17 00:00:00 2001 From: urosjarc Date: Tue, 2 Apr 2024 23:01:46 +0200 Subject: [PATCH] Tutorial for selective JOIN. --- README.md | 168 ++++++++++++++++++---------- build.gradle.kts | 6 +- src/tutorials/kotlin/Test_README.kt | 61 +++++++--- src/tutorials/kotlin/Test_README.md | 112 ++++++++++++------- 4 files changed, 232 insertions(+), 115 deletions(-) diff --git a/README.md b/README.md index f04db90d..be096d95 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@

db-messiah

-

Kotlin lib. for enterprise database development

+

+ Type safe SQL framework for Kotlin, built on top of JDBC and reflection.
+ Strong focus on simplicity and minimal developer interference.
+

+290 unit, +210 e2e, @@ -11,6 +14,63 @@ tested
+86% instruction coverage

+ +

+ Db Messiah scans user provided data classes and all their properties with reflection
+ in order to know how to decode user actions like `db.table.create()`
+ into prepared SQL statements that are type safe, escaped, and free from SQL injections. +

+ +

+ Because everything is scanned with reflection,
+ your data classes will directly represent your whole database structure,
+ without the need of developer interference or any additional work.
+ Here is an minimalistic example how would you define database with one table... +

+ +```kotlin +data class TestTable(var id: Int? = null, val column: String) + +val db = SqliteService( + config = Properties().apply { this["jdbcUrl"] = "jdbc:sqlite::memory:" }, + ser = SqliteSerializer( + tables = listOf(Table(TestTable::id)), + globalSerializers = BasicTS.sqlite + ) +) + +db.autocommit { + val row = TestTable(column = "col0") + it.table.drop() + it.table.create() + it.table.delete() + it.row.insert(row) + assert(row.id != null) + assert(it.row.select(pk = 1)!! == row) + assert(it.table.select() == listOf(row)) + it.table.delete() +} +``` + +Because of that, it provides very simple solution for writing complex queries.
+There are only 4 methods to be remembered: it.name, it.column, it.table, it.input
+Thats it! Everything else is joust ordinary SQL syntax that you know and love.
+This is an example how the most complex query in db-messiah looks like, +it's basically raw SQL with additional features like type safety and SQL injection . +

+ +```kotlin +val result = it.query.get(output = Out::class, input = parent) { + """ + SELECT ${it.column(Child::value)} AS ${it.name(Out::child_value)}, + ${it.column(Parent::value)} AS ${it.name(Out::parent_value)} + FROM ${it.table()} + JOIN ${it.table()} ON ${it.column(Parent::pk)} = ${it.column(Child::parent_pk)} + WHERE ${it.column(Child::value)} = ${it.input(Parent::value)} + """ +} +``` +

@@ -40,8 +100,8 @@ ```kotlin /** DEPENDENCIES */ -implementation("com.urosjarc:db-messiah:0.0.1") // Required -implementation("com.urosjarc:db-messiah-extra:0.0.1") // Optional +implementation("com.urosjarc:db-messiah:0.0.2") // Required +implementation("com.urosjarc:db-messiah-extra:0.0.2") // Optional implementation("org.apache.logging.log4j:log4j-slf4j2-impl:2.20.0") //Optional /** DRIVERS */ @@ -102,6 +162,10 @@ data class Unsafe( val pk: UUID = UUID.randomUUID(), // Unsafe UUID manual primary key val created: Instant = Instant.now() // Support for java.time.* ) + +/** QUERY DTO */ + +data class Out(val child_value: String, val parent_value: String) ```

Database

@@ -111,37 +175,30 @@ data class Unsafe( val sqliteSerializer = SqliteSerializer( globalSerializers = BasicTS.sqlite + JavaTimeTS.sqlite + listOf( - /** Serializer for Id */ IdTS.int(construct = { Id(it) }, deconstruct = { it.value }), - /** Serializer for UId */ IdTS.uuid.sqlite(construct = { UId(it) }) ), tables = listOf( Table(Unsafe::pk), Table(Parent::pk), Table( - Child::pk, - foreignKeys = listOf( - Child::parent_pk to Parent::class - ), + primaryKey = Child::pk, + foreignKeys = listOf(Child::parent_pk to Parent::class), constraints = listOf( Child::parent_pk to listOf(C.CASCADE_DELETE, C.CASCADE_UPDATE), Child::value to listOf(C.UNIQUE) ) ), ), + globalOutputs = listOf(Out::class), ) /** POSTGRES */ val pgSerializer = PgSerializer( - globalSerializers = BasicTS.sqlite + JavaTimeTS.postgresql, + globalSerializers = BasicTS.postgresql + JavaTimeTS.postgresql, schemas = listOf( - PgSchema( - name = "name", tables = listOf( - Table(Unsafe::pk), - ) - ), + PgSchema(name = "other", tables = listOf(Table(Unsafe::pk))) ), ) @@ -271,9 +328,8 @@ sqlite.autocommit { WHERE ${it.column(Child::value)} = ${it.input(Parent::value)} """ } - println(moreChildren) assert(moreChildren == listOf(children[3])) -} + ```

Transactions

@@ -396,52 +452,51 @@ For detailed explanation read about Specifications -| | Schema | Serializer | Service | Basic types | java.time.* types | -|:--------:|:-------------:|:----------------:|:-------------:|:-------------------:|:----------------------:| -| DB2 | Db2Schema | Db2Serializer | Db2Service | BasicTS.db2 | JavaTimeTS.db2 | -| Derby | DerbySchema | DerbySerializer | DerbyService | BasicTS.derby | JavaTimeTS.derby | -| H2 | H2Schema | H2Serializer | H2Service | BasicTS.h2 | JavaTimeTS.h2 | -| Maria | MariaSchema | MariaSerializer | MariaService | BasicTS.maria | JavaTimeTS.maria | -| MS SQL | MssqlSchema | MssqlSerializer | MssqlService | BasicTS.mssql | JavaTimeTS.mssql | -| MySQL | MysqlSchema | MysqlSerializer | MysqlService | BasicTS.mysql | JavaTimeTS.mysql | -| Oracle | OracleSchema | OracleSerializer | OracleService | BasicTS.oracle | JavaTimeTS.oracle | -| Postgres | PgSchema | PgSerializer | PgService | BasicTS. postgresql | JavaTimeTS. postgresql | -| Sqlite | :x: | SqliteSerializer | SqliteService | BasicTS.sqlite | JavaTimeTS.sqlite | +| | Schema | Serializer | Service | Basic types | java.time.* types | +|:--------:|:------------:|:----------------:|:-------------:|:-------------------:|:----------------------:| +| DB2 | Db2Schema | Db2Serializer | Db2Service | BasicTS.db2 | JavaTimeTS.db2 | +| Derby | DerbySchema | DerbySerializer | DerbyService | BasicTS.derby | JavaTimeTS.derby | +| H2 | H2Schema | H2Serializer | H2Service | BasicTS.h2 | JavaTimeTS.h2 | +| Maria | MariaSchema | MariaSerializer | MariaService | BasicTS.maria | JavaTimeTS.maria | +| MS SQL | MssqlSchema | MssqlSerializer | MssqlService | BasicTS.mssql | JavaTimeTS.mssql | +| MySQL | MysqlSchema | MysqlSerializer | MysqlService | BasicTS.mysql | JavaTimeTS.mysql | +| Oracle | OracleSchema | OracleSerializer | OracleService | BasicTS.oracle | JavaTimeTS.oracle | +| Postgres | PgSchema | PgSerializer | PgService | BasicTS. postgresql | JavaTimeTS. postgresql | +| Sqlite | :x: | SqliteSerializer | SqliteService | BasicTS.sqlite | JavaTimeTS.sqlite |

Features

-| | Escape | Schema | Auto INT PK | Auto UUID PK | UUID column | Many queries | Cascade | Procedure | +| | Escape | Schema | Auto INT PK | Auto UUID PK | UUID column | Many queries | Cascade | Procedure | |:--------:|:------:|:----------------------:|:------------------:|:------------------:|:------------:|:------------------:|:-------------------------------------:|:----------------------:| -| DB2 | "%s" | :large_orange_diamond: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :large_orange_diamond: | -| Derby | "%s" | :white_check_mark: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :x: | -| H2 | "%s" | :white_check_mark: | :white_check_mark: | :white_check_mark: | UUID | :x: | :white_check_mark: | :x: | -| Maria | \`%s\` | :white_check_mark: | :white_check_mark: | :x: | UUID | :x: | :x: | :white_check_mark: | -| MS SQL | [%s] | :white_check_mark: | :white_check_mark: | :x: | UNIQUEIDE... | :white_check_mark: | :x: | :white_check_mark: | -| MySQL | \`%s\` | :white_check_mark: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :white_check_mark: | -| Oracle | "%s" | :large_orange_diamond: | :white_check_mark: | :x: | VARCHAR2(36) | :x: | :white_check_mark: | :white_check_mark: | -| Postgres | "%s" | :white_check_mark: | :white_check_mark: | :white_check_mark: | UUID | :white_check_mark: | :white_check_mark: :white_check_mark: | :x: | -| Sqlite | "%s" | :x: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :x: | +| DB2 | "%s" | :large_orange_diamond: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :large_orange_diamond: | +| Derby | "%s" | :white_check_mark: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :x: | +| H2 | "%s" | :white_check_mark: | :white_check_mark: | :white_check_mark: | UUID | :x: | :white_check_mark: | :x: | +| Maria | \`%s\` | :white_check_mark: | :white_check_mark: | :x: | UUID | :x: | :x: | :white_check_mark: | +| MS SQL | [%s] | :white_check_mark: | :white_check_mark: | :x: | UNIQUEIDE... | :white_check_mark: | :x: | :white_check_mark: | +| MySQL | \`%s\` | :white_check_mark: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :white_check_mark: | +| Oracle | "%s" | :large_orange_diamond: | :white_check_mark: | :x: | VARCHAR2(36) | :x: | :white_check_mark: | :white_check_mark: | +| Postgres | "%s" | :white_check_mark: | :white_check_mark: | :white_check_mark: | UUID | :white_check_mark: | :white_check_mark: :white_check_mark: | :x: | +| Sqlite | "%s" | :x: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :x: |

Type system

-| KClass | COLUMN | Databases | db-messiah | db-messiah-extra | -|:---------------:|:------------:|:------------------------------------:|:-----------------------:|:--------------------------:| -| Boolean | BOOL | :white_check_mark: | :white_check_mark: | :x: | -| Char | CHAR | :white_check_mark: | :white_check_mark: | :x: | -| String | VARCHAR(100) | :white_check_mark: | :white_check_mark: | :x: | -| Float | FLOAT | :white_check_mark: | :white_check_mark: | :x: | -| Double | DOUBLE | :white_check_mark: | :white_check_mark: | :x: | -| Byte / UByte | TINYINT | :white_check_mark: | :white_check_mark: | :x: | -| Short / UShort | SMALLINT | :white_check_mark: | :white_check_mark: | :x: | -| Int / Uint | INTEGER | :white_check_mark: | :white_check_mark: | :x: | -| Long / ULong | BIGINT | :white_check_mark: | :white_check_mark: | :x: | -| Instant | DATETIME | Sqlite, Mysql, MSSql, Maria, H2, DB2 | Java :white_check_mark: | kotlinx :white_check_mark: | -| Instant | TIMESTAMP | Derby, Postgres, Oracle | Java :white_check_mark: | kotlinx :white_check_mark: | -| LocalDateTime | :x: | :x: | Java :x: | kotlinx :x: | -| LocalDate | DATE | :white_check_mark: | Java :white_check_mark: | kotlinx :white_check_mark: | -| LocalTime | TIME | :white_check_mark: but Oracle | Java :white_check_mark: | kotlinx :white_check_mark: | -| LocalTime | NUMBER(5, 0) | Oracle | Java :white_check_mark: | kotlinx :white_check_mark: |> - +| KClass | COLUMN | Databases | db-messiah | db-messiah-extra | +|:--------------:|:------------:|:------------------------------------:|:-----------------------:|:--------------------------:| +| Boolean | BOOL | :white_check_mark: | :white_check_mark: | :x: | +| Char | CHAR | :white_check_mark: | :white_check_mark: | :x: | +| String | VARCHAR(100) | :white_check_mark: | :white_check_mark: | :x: | +| Float | FLOAT | :white_check_mark: | :white_check_mark: | :x: | +| Double | DOUBLE | :white_check_mark: | :white_check_mark: | :x: | +| Byte / UByte | TINYINT | :white_check_mark: | :white_check_mark: | :x: | +| Short / UShort | SMALLINT | :white_check_mark: | :white_check_mark: | :x: | +| Int / Uint | INTEGER | :white_check_mark: | :white_check_mark: | :x: | +| Long / ULong | BIGINT | :white_check_mark: | :white_check_mark: | :x: | +| Instant | DATETIME | Sqlite, Mysql, MSSql, Maria, H2, DB2 | Java :white_check_mark: | kotlinx :white_check_mark: | +| Instant | TIMESTAMP | Derby, Postgres, Oracle | Java :white_check_mark: | kotlinx :white_check_mark: | +| LocalDateTime | :x: | :x: | Java :x: | kotlinx :x: | +| LocalDate | DATE | :white_check_mark: | Java :white_check_mark: | kotlinx :white_check_mark: | +| LocalTime | TIME | :white_check_mark: but Oracle | Java :white_check_mark: | kotlinx :white_check_mark: | +| LocalTime | NUMBER(5, 0) | Oracle | Java :white_check_mark: | kotlinx :white_check_mark: |>

PRIMARY KEY

@@ -452,7 +507,6 @@ For detailed explanation read about
INSERT BATCH -

UPDATE / DELETE

diff --git a/build.gradle.kts b/build.gradle.kts index c8acf1a1..b5b0d064 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -152,7 +152,7 @@ publishing { artifact(javadocJar) pom { name = "Db Messiah" - description = "Kotlin lib. for enterprise database development" + description = "Db Messiah, kotlin lib. for enterprise database development " url = github issueManagement { system = "Github" @@ -203,8 +203,8 @@ tasks.register("readme") { var readme = File("./src/tutorials/kotlin/Test_README.md").readText() val dependencies = mutableListOf( - "implementation(\"${project.group}:${project.name}:$version\") // Required", - "implementation(\"${project.group}:${project.name}-extra:$version\") // Optional", + "implementation(\"${project.group}:${project.name}:${project.version}\") // Required", + "implementation(\"${project.group}:${project.name}-extra:${project.version}\") // Optional", ) dependencies += optionals.map { "implementation(\"$it\") //Optional" } diff --git a/src/tutorials/kotlin/Test_README.kt b/src/tutorials/kotlin/Test_README.kt index 54cd3b0c..9f940c71 100644 --- a/src/tutorials/kotlin/Test_README.kt +++ b/src/tutorials/kotlin/Test_README.kt @@ -16,6 +16,7 @@ import java.time.Duration import java.time.Instant import java.util.* + // START 'Primary keys' /** TYPE SAFE ID */ @@ -56,6 +57,10 @@ data class Unsafe( val pk: UUID = UUID.randomUUID(), // Unsafe UUID manual primary key val created: Instant = Instant.now() // Support for java.time.* ) + +/** QUERY DTO */ + +data class Out(val child_value: String, val parent_value: String) // STOP // START 'Database' @@ -63,37 +68,30 @@ data class Unsafe( val sqliteSerializer = SqliteSerializer( globalSerializers = BasicTS.sqlite + JavaTimeTS.sqlite + listOf( - /** Serializer for Id */ IdTS.int(construct = { Id(it) }, deconstruct = { it.value }), - /** Serializer for UId */ IdTS.uuid.sqlite(construct = { UId(it) }) ), tables = listOf( Table(Unsafe::pk), Table(Parent::pk), Table( - Child::pk, - foreignKeys = listOf( - Child::parent_pk to Parent::class - ), + primaryKey = Child::pk, + foreignKeys = listOf(Child::parent_pk to Parent::class), constraints = listOf( Child::parent_pk to listOf(C.CASCADE_DELETE, C.CASCADE_UPDATE), Child::value to listOf(C.UNIQUE) ) ), ), + globalOutputs = listOf(Out::class), ) /** POSTGRES */ val pgSerializer = PgSerializer( - globalSerializers = BasicTS.sqlite + JavaTimeTS.postgresql, + globalSerializers = BasicTS.postgresql + JavaTimeTS.postgresql, schemas = listOf( - PgSchema( - name = "name", tables = listOf( - Table(Unsafe::pk), - ) - ), + PgSchema(name = "other", tables = listOf(Table(Unsafe::pk))) ), ) @@ -202,10 +200,21 @@ fun main() { WHERE ${it.column(Child::value)} = ${it.input(Parent::value)} """ } - println(moreChildren) assert(moreChildren == listOf(children[3])) + + // START 'Selective join' + val result = it.query.get(output = Out::class, input = parent) { + """ + SELECT ${it.column(Child::value)} AS ${it.name(Out::child_value)}, + ${it.column(Parent::value)} AS ${it.name(Out::parent_value)} + FROM ${it.table()} + JOIN ${it.table()} ON ${it.column(Parent::pk)} = ${it.column(Child::parent_pk)} + WHERE ${it.column(Child::value)} = ${it.input(Parent::value)} + """ + } + // STOP + assert(result == listOf(Out(child_value = "value_3", parent_value = "value_3"))) } - // STOP // START 'Transactions' sqlite.transaction { // Any exception inside will trigger rollback ALL! @@ -294,6 +303,30 @@ fun main() { IdTS.uuid.sqlite(construct = { UId(it) }) // STOP } + + // START 'Minimal example' + data class TestTable(var id: Int? = null, val column: String) + + val db = SqliteService( + config = Properties().apply { this["jdbcUrl"] = "jdbc:sqlite::memory:" }, + ser = SqliteSerializer( + tables = listOf(Table(TestTable::id)), + globalSerializers = BasicTS.sqlite + ) + ) + + db.autocommit { + val row = TestTable(column = "col0") + it.table.drop() + it.table.create() + it.table.delete() + it.row.insert(row) + assert(row.id != null) + assert(it.row.select(pk = 1)!! == row) + assert(it.table.select() == listOf(row)) + it.table.delete() + } +// STOP } class Test_README { diff --git a/src/tutorials/kotlin/Test_README.md b/src/tutorials/kotlin/Test_README.md index e1437c29..81134b75 100644 --- a/src/tutorials/kotlin/Test_README.md +++ b/src/tutorials/kotlin/Test_README.md @@ -1,5 +1,8 @@

db-messiah

-

Kotlin lib. for enterprise database development

+

+ Type safe SQL framework for Kotlin, built on top of JDBC and reflection.
+ Strong focus on simplicity and minimal developer interference.
+

+290 unit, +210 e2e, @@ -11,6 +14,35 @@ tested
+86% instruction coverage

+ +

+ Db Messiah scans user provided data classes and all their properties with reflection
+ in order to know how to decode user actions like `db.table.create()`
+ into prepared SQL statements that are type safe, escaped, and free from SQL injections. +

+ +

+ Because everything is scanned with reflection,
+ your data classes will directly represent your whole database structure,
+ without the need of developer interference or any additional work.
+ Here is an minimalistic example how would you define database with one table... +

+ +```kotlin +// START 'Minimal example' +``` + +Because of that, it provides very simple solution for writing complex queries.
+There are only 4 methods to be remembered: it.name, it.column, it.table, it.input
+Thats it! Everything else is joust ordinary SQL syntax that you know and love.
+This is an example how the most complex query in db-messiah looks like, +it's basically raw SQL with additional features like type safety and SQL injection . +

+ +```kotlin +// START 'Selective join' +``` +

@@ -158,52 +190,51 @@ For detailed explanation read about Specifications -| | Schema | Serializer | Service | Basic types | java.time.* types | -|:--------:|:-------------:|:----------------:|:-------------:|:-------------------:|:----------------------:| -| DB2 | Db2Schema | Db2Serializer | Db2Service | BasicTS.db2 | JavaTimeTS.db2 | -| Derby | DerbySchema | DerbySerializer | DerbyService | BasicTS.derby | JavaTimeTS.derby | -| H2 | H2Schema | H2Serializer | H2Service | BasicTS.h2 | JavaTimeTS.h2 | -| Maria | MariaSchema | MariaSerializer | MariaService | BasicTS.maria | JavaTimeTS.maria | -| MS SQL | MssqlSchema | MssqlSerializer | MssqlService | BasicTS.mssql | JavaTimeTS.mssql | -| MySQL | MysqlSchema | MysqlSerializer | MysqlService | BasicTS.mysql | JavaTimeTS.mysql | -| Oracle | OracleSchema | OracleSerializer | OracleService | BasicTS.oracle | JavaTimeTS.oracle | -| Postgres | PgSchema | PgSerializer | PgService | BasicTS. postgresql | JavaTimeTS. postgresql | -| Sqlite | :x: | SqliteSerializer | SqliteService | BasicTS.sqlite | JavaTimeTS.sqlite | +| | Schema | Serializer | Service | Basic types | java.time.* types | +|:--------:|:------------:|:----------------:|:-------------:|:-------------------:|:----------------------:| +| DB2 | Db2Schema | Db2Serializer | Db2Service | BasicTS.db2 | JavaTimeTS.db2 | +| Derby | DerbySchema | DerbySerializer | DerbyService | BasicTS.derby | JavaTimeTS.derby | +| H2 | H2Schema | H2Serializer | H2Service | BasicTS.h2 | JavaTimeTS.h2 | +| Maria | MariaSchema | MariaSerializer | MariaService | BasicTS.maria | JavaTimeTS.maria | +| MS SQL | MssqlSchema | MssqlSerializer | MssqlService | BasicTS.mssql | JavaTimeTS.mssql | +| MySQL | MysqlSchema | MysqlSerializer | MysqlService | BasicTS.mysql | JavaTimeTS.mysql | +| Oracle | OracleSchema | OracleSerializer | OracleService | BasicTS.oracle | JavaTimeTS.oracle | +| Postgres | PgSchema | PgSerializer | PgService | BasicTS. postgresql | JavaTimeTS. postgresql | +| Sqlite | :x: | SqliteSerializer | SqliteService | BasicTS.sqlite | JavaTimeTS.sqlite |

Features

-| | Escape | Schema | Auto INT PK | Auto UUID PK | UUID column | Many queries | Cascade | Procedure | +| | Escape | Schema | Auto INT PK | Auto UUID PK | UUID column | Many queries | Cascade | Procedure | |:--------:|:------:|:----------------------:|:------------------:|:------------------:|:------------:|:------------------:|:-------------------------------------:|:----------------------:| -| DB2 | "%s" | :large_orange_diamond: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :large_orange_diamond: | -| Derby | "%s" | :white_check_mark: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :x: | -| H2 | "%s" | :white_check_mark: | :white_check_mark: | :white_check_mark: | UUID | :x: | :white_check_mark: | :x: | -| Maria | \`%s\` | :white_check_mark: | :white_check_mark: | :x: | UUID | :x: | :x: | :white_check_mark: | -| MS SQL | [%s] | :white_check_mark: | :white_check_mark: | :x: | UNIQUEIDE... | :white_check_mark: | :x: | :white_check_mark: | -| MySQL | \`%s\` | :white_check_mark: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :white_check_mark: | -| Oracle | "%s" | :large_orange_diamond: | :white_check_mark: | :x: | VARCHAR2(36) | :x: | :white_check_mark: | :white_check_mark: | -| Postgres | "%s" | :white_check_mark: | :white_check_mark: | :white_check_mark: | UUID | :white_check_mark: | :white_check_mark: :white_check_mark: | :x: | -| Sqlite | "%s" | :x: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :x: | +| DB2 | "%s" | :large_orange_diamond: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :large_orange_diamond: | +| Derby | "%s" | :white_check_mark: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :x: | +| H2 | "%s" | :white_check_mark: | :white_check_mark: | :white_check_mark: | UUID | :x: | :white_check_mark: | :x: | +| Maria | \`%s\` | :white_check_mark: | :white_check_mark: | :x: | UUID | :x: | :x: | :white_check_mark: | +| MS SQL | [%s] | :white_check_mark: | :white_check_mark: | :x: | UNIQUEIDE... | :white_check_mark: | :x: | :white_check_mark: | +| MySQL | \`%s\` | :white_check_mark: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :white_check_mark: | +| Oracle | "%s" | :large_orange_diamond: | :white_check_mark: | :x: | VARCHAR2(36) | :x: | :white_check_mark: | :white_check_mark: | +| Postgres | "%s" | :white_check_mark: | :white_check_mark: | :white_check_mark: | UUID | :white_check_mark: | :white_check_mark: :white_check_mark: | :x: | +| Sqlite | "%s" | :x: | :white_check_mark: | :x: | CHAR(36) | :x: | :x: | :x: |

Type system

-| KClass | COLUMN | Databases | db-messiah | db-messiah-extra | -|:---------------:|:------------:|:------------------------------------:|:-----------------------:|:--------------------------:| -| Boolean | BOOL | :white_check_mark: | :white_check_mark: | :x: | -| Char | CHAR | :white_check_mark: | :white_check_mark: | :x: | -| String | VARCHAR(100) | :white_check_mark: | :white_check_mark: | :x: | -| Float | FLOAT | :white_check_mark: | :white_check_mark: | :x: | -| Double | DOUBLE | :white_check_mark: | :white_check_mark: | :x: | -| Byte / UByte | TINYINT | :white_check_mark: | :white_check_mark: | :x: | -| Short / UShort | SMALLINT | :white_check_mark: | :white_check_mark: | :x: | -| Int / Uint | INTEGER | :white_check_mark: | :white_check_mark: | :x: | -| Long / ULong | BIGINT | :white_check_mark: | :white_check_mark: | :x: | -| Instant | DATETIME | Sqlite, Mysql, MSSql, Maria, H2, DB2 | Java :white_check_mark: | kotlinx :white_check_mark: | -| Instant | TIMESTAMP | Derby, Postgres, Oracle | Java :white_check_mark: | kotlinx :white_check_mark: | -| LocalDateTime | :x: | :x: | Java :x: | kotlinx :x: | -| LocalDate | DATE | :white_check_mark: | Java :white_check_mark: | kotlinx :white_check_mark: | -| LocalTime | TIME | :white_check_mark: but Oracle | Java :white_check_mark: | kotlinx :white_check_mark: | -| LocalTime | NUMBER(5, 0) | Oracle | Java :white_check_mark: | kotlinx :white_check_mark: |> - +| KClass | COLUMN | Databases | db-messiah | db-messiah-extra | +|:--------------:|:------------:|:------------------------------------:|:-----------------------:|:--------------------------:| +| Boolean | BOOL | :white_check_mark: | :white_check_mark: | :x: | +| Char | CHAR | :white_check_mark: | :white_check_mark: | :x: | +| String | VARCHAR(100) | :white_check_mark: | :white_check_mark: | :x: | +| Float | FLOAT | :white_check_mark: | :white_check_mark: | :x: | +| Double | DOUBLE | :white_check_mark: | :white_check_mark: | :x: | +| Byte / UByte | TINYINT | :white_check_mark: | :white_check_mark: | :x: | +| Short / UShort | SMALLINT | :white_check_mark: | :white_check_mark: | :x: | +| Int / Uint | INTEGER | :white_check_mark: | :white_check_mark: | :x: | +| Long / ULong | BIGINT | :white_check_mark: | :white_check_mark: | :x: | +| Instant | DATETIME | Sqlite, Mysql, MSSql, Maria, H2, DB2 | Java :white_check_mark: | kotlinx :white_check_mark: | +| Instant | TIMESTAMP | Derby, Postgres, Oracle | Java :white_check_mark: | kotlinx :white_check_mark: | +| LocalDateTime | :x: | :x: | Java :x: | kotlinx :x: | +| LocalDate | DATE | :white_check_mark: | Java :white_check_mark: | kotlinx :white_check_mark: | +| LocalTime | TIME | :white_check_mark: but Oracle | Java :white_check_mark: | kotlinx :white_check_mark: | +| LocalTime | NUMBER(5, 0) | Oracle | Java :white_check_mark: | kotlinx :white_check_mark: |>

PRIMARY KEY

@@ -214,7 +245,6 @@ For detailed explanation read about
INSERT BATCH -

UPDATE / DELETE