Skip to content

Commit

Permalink
Merge pull request #1 from JetBrains/main
Browse files Browse the repository at this point in the history
import latest fixes
  • Loading branch information
saral authored Oct 2, 2023
2 parents 67ffc23 + e9c699a commit 3aa402e
Show file tree
Hide file tree
Showing 295 changed files with 20,762 additions and 3,018 deletions.
5 changes: 2 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ end_of_line = lf
indent_size = tab
indent_style = space
insert_final_newline = true
max_line_length = 150
max_line_length = 166
tab_width = 4
ij_formatter_off_tag = @formatter:off
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = true
ij_smart_tabs = true
Expand Down Expand Up @@ -41,6 +41,5 @@ ij_kotlin_spaces_around_equality_operators = true
ij_any_align_group_field_declarations = false
ij_java_align_group_field_declarations = false


[{.github/**/*.yml, .idea/*.xml}]
indent_size = 2
57 changes: 57 additions & 0 deletions .github/workflows/detekt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This workflow performs a static analysis of your Kotlin source code using detekt.
#
# Scans are triggered on every pull request targeting the main branch.

name: detekt

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Triggers the workflow on pull request events targeting the main branch
pull_request:
branches:
- main

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "detekt"
detekt:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
# Checks out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: "checkout"
uses: actions/checkout@v2
# Determines changed files
- name: "changed-files"
run: |
git fetch origin main:refs/remotes/origin/main
CHANGED_FILES=$(git --no-pager diff --name-only --diff-filter=dr origin/main HEAD -- . ':!exposed-tests' | grep '\(.*.kt\|.*.kts\)$' | tr '\n' , | rev | cut -c 2- | rev)
echo "Changed files: $CHANGED_FILES"
echo "CHANGED_FILES=$CHANGED_FILES" >> "$GITHUB_ENV"
# Resolves and installs a specific version of detekt on to a GitHub Actions Runner if not already present in the tool cache
- name: "set-up-detekt"
uses: peter-murray/setup-detekt@v2
with:
detekt_version: 1.23.1
# Runs detekt on changed files
- name: "run-detekt"
run: |
if [ -z "$CHANGED_FILES" ]
then
echo "No changed Kotlin files found."
exit 0
fi
echo "Running detekt check..."
DETEKT_ISSUES=$(detekt-cli --build-upon-default-config --config detekt/detekt-config.yml --plugins detekt/detekt-formatting-1.23.1.jar --input $CHANGED_FILES)
if [ -n "$DETEKT_ISSUES" ]; then
echo "***********************************************"
echo "$DETEKT_ISSUES"
echo "***********************************************"
echo " detekt failed "
echo " Please fix the above issues "
echo "***********************************************"
exit 1
fi
25 changes: 18 additions & 7 deletions .idea/detekt.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

188 changes: 175 additions & 13 deletions docs/README.md → README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div align="center">
<img align="center" src="./logo.png" alt="Exposed" width="315" /></div>
<img align="center" src="./docs/logo.png" alt="Exposed" width="315" /></div>
<br><br>

[![JetBrains team project](https://jb.gg/badges/team.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![Kotlinlang Slack Channel](https://img.shields.io/badge/slack-@kotlinlang/exposed-yellow.svg?logo=slack?style=flat)](https://kotlinlang.slack.com/archives/C0CG7E0A1)
[![TC Build status](https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:KotlinTools_Exposed_Build)/statusIcon)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=KotlinTools_Exposed_Build&guest=1)
[![TC Build status](https://exposed.teamcity.com/app/rest/builds/buildType:id:Exposed_Build/statusIcon.svg)](https://exposed.teamcity.com/viewType.html?buildTypeId=Exposed_Build&guest=1)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.jetbrains.exposed/exposed-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.jetbrains.exposed/exposed-core)
[![GitHub License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)

Expand All @@ -13,18 +13,179 @@
Exposed is a lightweight SQL library on top of JDBC driver for Kotlin language.
Exposed has two flavors of database access: typesafe SQL wrapping DSL and lightweight Data Access Objects (DAO).

With Exposed you can have two levels of databases Access. You would like to use exposed because the database access includes wrapping DSL and a lightweight data access object. Also, our official mascot is Cuttlefish, which is well known for its outstanding mimicry ability that enables it to blend seamlessly in any environment.
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.

## Supported Databases

- ![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](ORACLE.md)
- [SQL Server](SQLServer.md)
- 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
<!-- Versions after 0.30.1 -->
<!-- Versions before 0.30.1 is unavailable for now-->
<repositories>
<repository>
<id>mavenCentral</id>
<name>mavenCentral</name>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</repositories>
```

#### Gradle Groovy and Kotlin DSL

**Warning:** You might need to set your Kotlin JVM target to 8 and when using Spring to 17 in order for it to work properly

```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

<dependencies>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-core</artifactId>
<version>0.44.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-crypt</artifactId>
<version>0.44.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-dao</artifactId>
<version>0.44.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-java-time</artifactId>
<version>0.44.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-jdbc</artifactId>
<version>0.44.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-jodatime</artifactId>
<version>0.44.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-json</artifactId>
<version>0.44.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-kotlin-datetime</artifactId>
<version>0.44.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-money</artifactId>
<version>0.44.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.exposed</groupId>
<artifactId>exposed-spring-boot-starter</artifactId>
<version>0.44.0</version>
</dependency>
</dependencies>

```

#### Gradle Groovy

```groovy
dependencies {
implementation 'org.jetbrains.exposed:exposed-core:0.44.0'
implementation 'org.jetbrains.exposed:exposed-crypt:0.44.0'
implementation 'org.jetbrains.exposed:exposed-dao:0.44.0'
implementation 'org.jetbrains.exposed:exposed-jdbc:0.44.0'
implementation 'org.jetbrains.exposed:exposed-jodatime:0.44.0'
// or
implementation 'org.jetbrains.exposed:exposed-java-time:0.44.0'
// or
implementation 'org.jetbrains.exposed:exposed-kotlin-datetime:0.44.0'
implementation 'org.jetbrains.exposed:exposed-json:0.44.0'
implementation 'org.jetbrains.exposed:exposed-money:0.44.0'
implementation 'org.jetbrains.exposed:exposed-spring-boot-starter:0.44.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.44.0
```

## Samples

Check out the [samples](samples/README.md) for a quick start.

## Links

Expand All @@ -33,15 +194,16 @@ Currently, Exposed is available for **maven/gradle builds**. Check the [Maven Ce
For more information visit the links below:

- [Wiki](https://github.com/JetBrains/Exposed/wiki) with examples and docs
- [Roadmap](ROADMAP.md) to see what's coming next
- [Change log](ChangeLog.md) of improvements and bug fixes
- [Roadmap](docs/ROADMAP.md) to see what's coming next
- [Change log](docs/ChangeLog.md) of improvements and bug fixes
- [Breaking changes](docs/BREAKING_CHANGES.md) and any migration details
- [Slack Channel](https://kotlinlang.slack.com/archives/C0CG7E0A1)
- [Issue Tracker](https://youtrack.jetbrains.com/issues/EXPOSED)
<br><br>

## Filing issues

Please note that we are moving away from GitHub Issues for reporting of bugs and features. Please log any new requests on [YouTrack](https://youtrack.jetbrains.com/issues/EXPOSED).
Please note that we are moving away from GitHub Issues for reporting of bugs and features. Please log any new requests on [YouTrack](https://youtrack.jetbrains.com/issues/EXPOSED). You must be logged in to view and log issues, otherwise you will be met with a 404.

## Community

Expand Down
File renamed without changes.
Loading

0 comments on commit 3aa402e

Please sign in to comment.