Skip to content

Commit

Permalink
Adding README.md infos.
Browse files Browse the repository at this point in the history
  • Loading branch information
urosjarc committed Mar 30, 2024
1 parent 515c43c commit 1604ffd
Showing 1 changed file with 107 additions and 0 deletions.
107 changes: 107 additions & 0 deletions README.md
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: |>

0 comments on commit 1604ffd

Please sign in to comment.