GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jasync-sql/jasync-sql: Java & Kotlin Async DataBase Driver for MySQL and PostgreSQL written in Kotlin

BranchesTags
Open more actions menu

Latest commit

 

History

1,297 Commits
1,297 Commits

Folders and files

NameName
Last commit message
Last commit date
.agents/skills/release_jasync_sql
.agents/skills/release_jasync_sql
 
 
.github
.github
 
 
db-async-common
db-async-common
 
 
gradle/wrapper
gradle/wrapper
 
 
mysql-async
mysql-async
 
 
pool-async
pool-async
 
 
postgis-jasync
postgis-jasync
 
 
postgresql-async
postgresql-async
 
 
r2dbc-mysql
r2dbc-mysql
 
 
resources
resources
 
 
samples
samples
 
 
the-old-files
the-old-files
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
RELEASING.md
RELEASING.md
 
 
build.gradle.kts
build.gradle.kts
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

Chat at https://gitter.im/jasync-sql/support Maven Central Build Status Apache License V.2 codecov Awesome Kotlin Badge

jasync-sql is a Simple, Netty based, asynchronous, performant and reliable database drivers for PostgreSQL and MySQL written in Kotlin.

Show your ❤ with a ★

Getting started

// Connection to MySQL DB
Connection connection = MySQLConnectionBuilder.createConnectionPool(
               "jdbc:mysql://$host:$port/$database?user=$username&password=$password");
     
// Connection to PostgreSQL DB    
Connection connection = PostgreSQLConnectionBuilder.createConnectionPool(
               "jdbc:postgresql://$host:$port/$database?user=$username&password=$password");
// Execute query
CompletableFuture<QueryResult> future = connection.sendPreparedStatement("select * from table");
// work with result ...
// Close the connection pool
connection.disconnect().get()

See a full example at jasync-mysql-example and jasync-postgresql-example.
More samples on the samples dir.

For docs and info see the wiki.

Download

Maven

<!-- mysql -->
<dependency>
  <groupId>com.github.jasync-sql</groupId>
  <artifactId>jasync-mysql</artifactId>
  <version>2.2.6</version>
</dependency>

<!-- postgresql -->
<dependency>
    <groupId>com.github.jasync-sql</groupId>
    <artifactId>jasync-postgresql</artifactId>
    <version>2.2.6</version>
</dependency>

Gradle

dependencies {
  // mysql
  compile 'com.github.jasync-sql:jasync-mysql:2.2.6'
  // postgresql
  compile 'com.github.jasync-sql:jasync-postgresql:2.2.6'
}

Additional Modules

  • com.github.jasync-sql:jasync-r2dbc-mysql r2dbc extension.
  • com.github.jasync-sql:postgis-jasync spatial types support for postgres + postgis.
  • com.github.jasync-sql:pool-async async objects pool.
  • com.github.jasync-sql:db-async-common internal module for shared logic.

Overview

This project is a port of mauricio/postgresql-async to Kotlin.
Why? Because the original lib is not maintained anymore, We use it in ob1k, and would like to remove the Scala dependency in ob1k.

If you want information specific to the drivers, check the PostgreSQL README and the MySQL README.

You can view the project's change log here.

Follow us on twitter: @jasyncs.

DateTime:

Version 1.x always returns JodaTime when dealing with date types and not the java.util.Date class nor jdk-8 dates.
Version 2.x works with java 8 DateTime objects (java.time.LocalDateTime and such).
This post can help with migration.

Who is using it

  • R2DBC
  • Spring Data R2DBC
  • Vert.x
  • micronaut
  • Outbrain/ob1k-db
  • https://github.com/humb1t/jpom
  • Zeko Data Mapper and Zeko SQL Builder
  • vertx-jooq async module
  • ScalikeJDBC Async
  • Quill
  • Jasync SQL Extensions

Add your name here!

Is it used in production on large scale?

jasync-sql-production

The graph above is from only couple of services using it. Y-Axis is # of queries per minute.

There is also a TechEmpower test using ktor and jasync-sql.

Zeko SQL Builder compared jasync to hikary and vertex:
jasync-sql-zeko

Compatibility

Latest & greatest version is Maven Central

The driver was forked from mauricio/postgresql-async and is compatible with it (but not jdbc compatible!). More details in wiki.

R2DBC:

  • Initial support in jasync 0.9.51.
  • Support for 0.8 released version since jasync 1.0.12.
  • Upgrade to GA 1.0 R2DBC (spring boot >= 3) was done in jasync 2.1.0. jaync-sql 2.0.8 will be the last version that's compatible with r2dbc <= 0.9.1. See also FAQ.

Postgis support added in 2.1.7 (see blog post).

Unix domain socket support was added in 2.1.6 (see #175).

Chanlog is currently documented in github release page. Previous ones can be found here and older here.

Notable changes:

  • First driver release is version 0.8.20.
  • First driver release to maven is 1.0.0.
  • Migrating from joda to java 8 times was done in 2.0.0 (see #233). Versions <= 2.0 are not suppoprted anymore.

Support

  • Check FAQ or Known Issues or google.
  • Open an issue here: https://github.com/jasync-sql/jasync-sql/issues
  • Chat on gitter: https://gitter.im/jasync-sql/support
  • Ask a question in StackOverflow with jasync-sql tag.

More links

  • How we cloned the original lib.
  • https://github.com/mauricio/postgresql-async - The original (deprecated) lib.
  • Async database access with MySQL, Kotlin and jasync-sql.
  • Issue with NUMERIC.
  • jasync-sql + javalin example.
  • jasync-sql + ktor + coroutines example.
  • jasync-sql + spring + kotlin example.
  • How to implement an Object Pool with an Actor in Kotlin.
  • Coroutines usage.
  • Spring Data R2DBC video.
  • JDBC for Spring WebFlux: Spring Data R2DBC.
  • Spring WebFlux는 어떻게 적은 리소스로 많은 트래픽을 감당할까?.

Contributing

Pull requests are welcome!
See CONTRIBUTING.

About

Java & Kotlin Async DataBase Driver for MySQL and PostgreSQL written in Kotlin

Topics

async-jdbcjdbcjdbc-drivermysql-driverpostgresql-driverreactivesql

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity
Custom properties

Stars

1.7k stars

Watchers

30 watching

Forks

137 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.