-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<h1 align="center">db-messiah-extra</h1> | ||
<h3 align="center">Extra Utils for Db Messiah, kotlin lib. for enterprise database development</h3> | ||
<br> | ||
<br> | ||
<table width="100%" border="0"> | ||
<tr> | ||
<td width="33%"> | ||
<h3 align="center"><a href="https://github.com/urosjarc/db-messiah">db-messiah</a></h3> | ||
<p align="center">Kotlin lib. for enterprise database development</p> | ||
</td> | ||
<td width="33%" align="center"> | ||
<p><a href="#get-started">Get started</a></p> | ||
<p><a href="#tutorials">Tutorials</a></p> | ||
<p><a href="#configuration">Configuration</a></p> | ||
<p><a href="#features">Features</a></p> | ||
<p><a href="#specifications">Specifications</a></p> | ||
</td> | ||
<td width="33%"> | ||
<h3 align="center"><a href="https://github.com/urosjarc/db-analyser">db-analyser</a></h3> | ||
<p align="center">GUI for db analysis, to help you create complex JOIN statements for SQL or db-messiah. | ||
</td> | ||
</tr> | ||
</table> | ||
<br> | ||
<br> | ||
|
||
<h2 align="center">Get started</h2> | ||
|
||
```kotlin | ||
implementation("com.urosjarc:db-messiah-extra:0.0.1") | ||
``` | ||
|
||
<br><h3 align="center">DB Serializers</h3> | ||
|
||
```kotlin | ||
/** kolinx.datetime */ | ||
|
||
// SQLITE | ||
val sqliteSerializer = SqliteSerializer( | ||
globalSerializers = BasicTS.sqlite + KotlinxTimeTS.sqlite, | ||
... | ||
) | ||
|
||
// POSTGRESQL | ||
val pgSerializer = PgSerializer( | ||
globalSerializers = BasicTS.postgresql + KotlinxTimeTS.postgresql, | ||
... | ||
) | ||
|
||
|
||
``` | ||
|
||
<br><h3 align="center">JSON Serializers</h3> | ||
|
||
<table width="100%"> | ||
<tr> | ||
<td width="50%" align="center">JSON</td> | ||
<td width="50%" align="center">KTOR</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
|
||
```kotlin | ||
val json = Json { | ||
serializersModule = SerializersModule { | ||
contextual(InstantSerializer) | ||
contextual(LocalDateSerializer) | ||
contextual(LocalTimeSerializer) | ||
contextual(UUIDSerializer) | ||
} | ||
} | ||
|
||
val jsonStr = json.encodeToString(...) | ||
val obj = json.decodeFromString<...>(...) | ||
``` | ||
|
||
</td> | ||
|
||
<td> | ||
|
||
```kotlin | ||
install(ContentNegotiation) { | ||
json(Json { | ||
serializersModule = SerializersModule { | ||
contextual(InstantSerializer) | ||
contextual(LocalDateSerializer) | ||
contextual(LocalTimeSerializer) | ||
contextual(UUIDSerializer) | ||
} | ||
}) | ||
} | ||
``` | ||
|
||
</td> | ||
</tr> | ||
</table> | ||
|
||
|
||
<br><h3 align="center">Features</h3> | ||
|
||
| Class | COLUMN | Databases | db-messiah-extra | JSON | | ||
|:--------------:|:------------:|:------------------------------------:|:-----------------------:|:--------------------------:| | ||
| 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: | | ||
| 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: |> |