From 67c3ee664ac1aff28001b76a8478c6940e60d212 Mon Sep 17 00:00:00 2001 From: Jocelyne Date: Thu, 3 Aug 2023 18:09:42 +0200 Subject: [PATCH] chore: Add Maven coordinates in README.md --- README.md | 175 +++++++++++++++++- .../Writerside/topics/Getting-Started.md | 8 +- .../topics/Modules-Documentation.md | 154 ++++++++++----- 3 files changed, 279 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 813287fb57..e8505aab39 100644 --- a/README.md +++ b/README.md @@ -16,19 +16,174 @@ Exposed has two flavors of database access: typesafe SQL wrapping DSL and lightw With Exposed, you have two ways for database access: wrapping DSL and a lightweight DAO. Our official mascot is the cuttlefish, which is well-known for its outstanding mimicry ability that enables it to blend seamlessly into any environment. Similar to our mascot, Exposed can be used to mimic a variety of database engines and help you build applications without dependencies on any specific database engine and switch between them with very little or no changes. -## Samples +## Supported Databases -Check out the [samples](samples/README.md) for a quick start. +- H2 (versions 2.x; 1.x version is deprecated and will be removed in future releases) +- ![MariaDB](https://img.shields.io/badge/MariaDB-003545?style=for-the-badge&logo=mariadb&logoColor=white) +- ![MySQL](https://img.shields.io/badge/mysql-%2300f.svg?style=for-the-badge&logo=mysql&logoColor=white) +- [Oracle](docs/ORACLE.md) +- ![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge&logo=postgresql&logoColor=white) (Also, PostgreSQL using + the [pgjdbc-ng](https://github.com/impossibl/pgjdbc-ng) JDBC driver) +- [SQL Server](docs/SQLServer.md) +- ![SQLite](https://img.shields.io/badge/sqlite-%2307405e.svg?style=for-the-badge&logo=sqlite&logoColor=white) + +## Dependencies + +### Maven Central configuration + +Releases of Exposed are available in the Maven Central repository. You can declare this repository in your build script as follows: + +#### Maven + +```xml + + + + + mavenCentral + mavenCentral + https://repo1.maven.org/maven2/ + + +``` -## Supported Databases +#### Gradle Groovy and Kotlin DSL + +```kotlin +repositories { + // Versions after 0.30.1 + // Versions before 0.30.1 is unavailable for now + mavenCentral() +} +``` + +### Exposed modules + +`Exposed` consists of the following modules: + +* exposed-core - base module, which contains both DSL api along with mapping +* exposed-crypt - provides additional column types to store encrypted data in DB and encode/decode it on client-side +* exposed-dao - DAO api +* exposed-java-time - date-time extensions based on Java8 Time API +* exposed-jdbc - transport level implementation based on Java JDBC API +* exposed-jodatime - date-time extensions based on JodaTime library +* exposed-json - JSON and JSONB data type extensions +* exposed-kotlin-datetime - date-time extensions based on kotlinx-datetime +* exposed-money - extensions to support MonetaryAmount from "javax.money:money-api" +* exposed-spring-boot-starter - a starter for [Spring Boot](https://spring.io/projects/spring-boot) to utilize Exposed as the ORM instead + of [Hibernate](https://hibernate.org/) + +```xml + + + + org.jetbrains.exposed + exposed-core + 0.42.0 + + + org.jetbrains.exposed + exposed-crypt + 0.42.0 + + + org.jetbrains.exposed + exposed-dao + 0.42.0 + + + org.jetbrains.exposed + exposed-java-time + 0.42.0 + + + org.jetbrains.exposed + exposed-jdbc + 0.42.0 + + + org.jetbrains.exposed + exposed-jodatime + 0.42.0 + + + org.jetbrains.exposed + exposed-json + 0.42.0 + + + org.jetbrains.exposed + exposed-kotlin-datetime + 0.42.0 + + + org.jetbrains.exposed + exposed-money + 0.42.0 + + + org.jetbrains.exposed + exposed-spring-boot-starter + 0.42.0 + + + +``` + +#### Gradle Groovy + +```groovy +dependencies { + implementation 'org.jetbrains.exposed:exposed-core:0.42.0' + implementation 'org.jetbrains.exposed:exposed-crypt:0.42.0' + implementation 'org.jetbrains.exposed:exposed-dao:0.42.0' + implementation 'org.jetbrains.exposed:exposed-jdbc:0.42.0' + + implementation 'org.jetbrains.exposed:exposed-jodatime:0.42.0' + // or + implementation 'org.jetbrains.exposed:exposed-java-time:0.42.0' + // or + implementation 'org.jetbrains.exposed:exposed-kotlin-datetime:0.42.0' + + implementation 'org.jetbrains.exposed:exposed-json:0.42.0' + implementation 'org.jetbrains.exposed:exposed-money:0.42.0' + implementation 'org.jetbrains.exposed:exposed-spring-boot-starter:0.42.0' +} +``` + +#### Gradle Kotlin DSL + +In `build.gradle.kts`: + +```kotlin +val exposedVersion: String by project +dependencies { + implementation("org.jetbrains.exposed:exposed-core:$exposedVersion") + implementation("org.jetbrains.exposed:exposed-crypt:$exposedVersion") + implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion") + implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion") + + implementation("org.jetbrains.exposed:exposed-jodatime:$exposedVersion") + // or + implementation("org.jetbrains.exposed:exposed-java-time:$exposedVersion") + // or + implementation("org.jetbrains.exposed:exposed-kotlin-datetime:$exposedVersion") + + implementation("org.jetbrains.exposed:exposed-json:$exposedVersion") + implementation("org.jetbrains.exposed:exposed-money:$exposedVersion") + implementation("org.jetbrains.exposed:exposed-spring-boot-starter:$exposedVersion") +} +``` -- ![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge&logo=postgresql&logoColor=white) (Also, PostgreSQL using the [pgjdbc-ng](https://github.com/impossibl/pgjdbc-ng) JDBC driver) -- ![MySQL](https://img.shields.io/badge/mysql-%2300f.svg?style=for-the-badge&logo=mysql&logoColor=white) -- ![MariaDB](https://img.shields.io/badge/MariaDB-003545?style=for-the-badge&logo=mariadb&logoColor=white) -- ![SQLite](https://img.shields.io/badge/sqlite-%2307405e.svg?style=for-the-badge&logo=sqlite&logoColor=white) -- H2 (versions 2.x; 1.x version is deprecated and will be removed in future releases) -- [Oracle](docs/ORACLE.md) -- [SQL Server](docs/SQLServer.md) +and in `gradle.properties` + +``` +exposedVersion=0.42.0 +``` + +## Samples + +Check out the [samples](samples/README.md) for a quick start. ## Links diff --git a/documentation-website/Writerside/topics/Getting-Started.md b/documentation-website/Writerside/topics/Getting-Started.md index e8a0bb4407..efdab8f9fe 100644 --- a/documentation-website/Writerside/topics/Getting-Started.md +++ b/documentation-website/Writerside/topics/Getting-Started.md @@ -18,17 +18,17 @@ org.jetbrains.exposed exposed-core - 0.40.1 + 0.42.0 org.jetbrains.exposed exposed-dao - 0.40.1 + 0.42.0 org.jetbrains.exposed exposed-jdbc - 0.40.1 + 0.42.0 ]]> @@ -37,7 +37,7 @@ @@ -28,29 +30,36 @@ repositories { ``` ## Base Modules + ### Exposed 0.17.x and lower + Prior Exposed 0.18.1 there was only one base module `exposed` which contains everything you may need including JodaTime as date-time library. To add `Exposed` framework of that version you had to use: #### Maven + ```xml + - - org.jetbrains.exposed - exposed - 0.17.7 - + + org.jetbrains.exposed + exposed + 0.17.7 + ``` #### Gradle Groovy + ```groovy dependencies { - implementation 'org.jetbrains.exposed:exposed:0.17.7' + implementation 'org.jetbrains.exposed:exposed:0.17.7' } ``` + #### Gradle Kotlin DSL + ```kotlin dependencies { implementation("org.jetbrains.exposed", "exposed", "0.17.7") @@ -58,84 +67,141 @@ dependencies { ``` ### Exposed 0.18.1 and higher -To move forward and support such features as Java 8 Time, async drivers and so on it was decided to split Exposed into more specific modules. It will allow you to take the only modules you need and will add flexibility in the future. -At the moment `Exposed` coexists of provided modules +To move forward and support such features as Java 8 Time, async drivers, and so on, it was decided to split Exposed into more specific modules. It will allow you to +take the only modules you need and will add flexibility in the future. + +`Exposed` consists of the following modules: + * exposed-core - base module, which contains both DSL api along with mapping +* exposed-crypt - provides additional column types to store encrypted data in DB and encode/decode it on client-side * exposed-dao - DAO api +* exposed-java-time - date-time extensions based on Java8 Time API * exposed-jdbc - transport level implementation based on Java JDBC API * exposed-jodatime - date-time extensions based on JodaTime library -* exposed-java-time - date-time extensions based on Java8 Time API +* exposed-json - JSON and JSONB data type extensions * exposed-kotlin-datetime - date-time extensions based on kotlinx-datetime * exposed-money - extensions to support MonetaryAmount from "javax.money:money-api" -* exposed-crypt - provides additional column types to store encrypted data in DB and encode/decode it on client-side -* exposed-json - JSON and JSONB data type extensions +* exposed-spring-boot-starter - a starter for [Spring Boot](https://spring.io/projects/spring-boot) to utilize Exposed as the ORM instead + of [Hibernate](https://hibernate.org/) Dependencies mapping listed below is similar (by functionality) to the previous versions: + #### Maven + ```xml - - org.jetbrains.exposed - exposed-core - 0.40.1 - - - org.jetbrains.exposed - exposed-dao - 0.40.1 - - - org.jetbrains.exposed - exposed-jdbc - 0.40.1 - - - org.jetbrains.exposed - exposed-jodatime - 0.40.1 - - - org.jetbrains.exposed - exposed-java-time - 0.40.1 - + + org.jetbrains.exposed + exposed-core + 0.42.0 + + + org.jetbrains.exposed + exposed-crypt + 0.42.0 + + + org.jetbrains.exposed + exposed-dao + 0.42.0 + + + org.jetbrains.exposed + exposed-java-time + 0.42.0 + + + org.jetbrains.exposed + exposed-jdbc + 0.42.0 + + + org.jetbrains.exposed + exposed-jodatime + 0.42.0 + + + org.jetbrains.exposed + exposed-json + 0.42.0 + + + org.jetbrains.exposed + exposed-kotlin-datetime + 0.42.0 + + + org.jetbrains.exposed + exposed-money + 0.42.0 + + + org.jetbrains.exposed + exposed-spring-boot-starter + 0.42.0 + ``` #### Gradle Groovy + ```groovy dependencies { - implementation 'org.jetbrains.exposed:exposed-core:0.40.1' - implementation 'org.jetbrains.exposed:exposed-dao:0.40.1' - implementation 'org.jetbrains.exposed:exposed-jdbc:0.40.1' - implementation 'org.jetbrains.exposed:exposed-jodatime:0.40.1' - // or - implementation 'org.jetbrains.exposed:exposed-java-time:0.40.1' + implementation 'org.jetbrains.exposed:exposed-core:0.42.0' + implementation 'org.jetbrains.exposed:exposed-crypt:0.42.0' + implementation 'org.jetbrains.exposed:exposed-dao:0.42.0' + implementation 'org.jetbrains.exposed:exposed-jdbc:0.42.0' + + implementation 'org.jetbrains.exposed:exposed-jodatime:0.42.0' + // or + implementation 'org.jetbrains.exposed:exposed-java-time:0.42.0' + // or + implementation 'org.jetbrains.exposed:exposed-kotlin-datetime:0.42.0' + + implementation 'org.jetbrains.exposed:exposed-json:0.42.0' + implementation 'org.jetbrains.exposed:exposed-money:0.42.0' + implementation 'org.jetbrains.exposed:exposed-spring-boot-starter:0.42.0' } ``` + #### Gradle Kotlin DSL + In `build.gradle.kts`: + ```kotlin val exposedVersion: String by project dependencies { implementation("org.jetbrains.exposed:exposed-core:$exposedVersion") + implementation("org.jetbrains.exposed:exposed-crypt:$exposedVersion") implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion") implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion") + implementation("org.jetbrains.exposed:exposed-jodatime:$exposedVersion") // or implementation("org.jetbrains.exposed:exposed-java-time:$exposedVersion") + // or + implementation("org.jetbrains.exposed:exposed-kotlin-datetime:$exposedVersion") + + implementation("org.jetbrains.exposed:exposed-json:$exposedVersion") + implementation("org.jetbrains.exposed:exposed-money:$exposedVersion") + implementation("org.jetbrains.exposed:exposed-spring-boot-starter:$exposedVersion") } ``` + and in `gradle.properties` + ``` -exposedVersion=0.40.1 +exposedVersion=0.42.0 ``` ### JDBC driver and logging -You also need a JDBC driver for the database system you are using (see [Databases](Databases.md)) and a logger for `addLogger(StdOutSqlLogger)`. Example (Gradle syntax): + +You also need a JDBC driver for the database system you are using (see [Databases](Databases.md)) and a logger for `addLogger(StdOutSqlLogger)`. Example (Gradle +syntax): + ```kotlin dependencies { // for H2