|
1 |
| -<img width="550" alt="jasync-sql" src="resources/jas.png" style="max-width:100%;"> |
2 | 1 |
|
3 |
| -[](https://gitter.im//jasync-sql/support) [](https://search.maven.org/search?q=g:%22com.github.jasync-sql%22%20AND%20a:%22jasync-common%22)  [](https://github.com/jasync-sql/jasync-sql/blob/master/LICENSE) [](https://codecov.io/gh/jasync-sql/jasync-sql) [](https://github.com/KotlinBy/awesome-kotlin#libraries-frameworks-database) |
4 |
| - |
5 |
| -[jasync-sql](https://github.com/jasync-sql/jasync-sql) is a Simple, Netty based, asynchronous, performant and reliable database drivers for |
6 |
| -PostgreSQL and MySQL written in Kotlin. |
7 |
| - |
8 |
| -[Show your ❤ with a ★](https://github.com/jasync-sql/jasync-sql/stargazers) |
9 |
| - |
10 |
| -## Getting started |
11 |
| - |
12 |
| -```Java |
13 |
| -// Connection to MySQL DB |
14 |
| -Connection connection = MySQLConnectionBuilder.createConnectionPool( |
15 |
| - "jdbc:mysql://$host:$port/$database?user=$username&password=$password"); |
16 |
| - |
17 |
| -// Connection to PostgreSQL DB |
18 |
| -Connection connection = PostgreSQLConnectionBuilder.createConnectionPool( |
19 |
| - "jdbc:postgresql://$host:$port/$database?user=$username&password=$password"); |
20 |
| - |
21 |
| -// Execute query |
22 |
| -CompletableFuture<QueryResult> future = connection.sendPreparedStatement("select * from table"); |
23 |
| -// work with result ... |
24 |
| -// Close the connection pool |
25 |
| -connection.disconnect().get() |
26 |
| -``` |
27 |
| - |
28 |
| -See a full example at [jasync-mysql-example](https://github.com/jasync-sql/jasync-mysql-example) and [jasync-postgresql-example](https://github.com/jasync-sql/jasync-postgresql-example). |
29 |
| -More samples on the [samples dir](https://github.com/jasync-sql/jasync-sql/tree/master/samples). |
30 |
| - |
31 |
| -For docs and info see the [wiki](https://github.com/jasync-sql/jasync-sql/wiki). |
32 |
| - |
33 |
| -## Download |
34 |
| - |
35 |
| - |
36 |
| -### Maven |
37 |
| - |
38 |
| -```xml |
39 |
| -<!-- mysql --> |
40 |
| -<dependency> |
41 |
| - <groupId>com.github.jasync-sql</groupId> |
42 |
| - <artifactId>jasync-mysql</artifactId> |
43 |
| - <version>2.0.3</version> |
44 |
| -</dependency> |
45 |
| -<!-- postgresql --> |
46 |
| -<dependency> |
47 |
| - <groupId>com.github.jasync-sql</groupId> |
48 |
| - <artifactId>jasync-postgresql</artifactId> |
49 |
| - <version>2.0.3</version> |
50 |
| -</dependency> |
51 |
| -``` |
52 |
| - |
53 |
| -### Gradle |
54 |
| - |
55 |
| -```gradle |
56 |
| -dependencies { |
57 |
| - // mysql |
58 |
| - compile 'com.github.jasync-sql:jasync-mysql:2.0.3' |
59 |
| - // postgresql |
60 |
| - compile 'com.github.jasync-sql:jasync-postgresql:2.0.3' |
61 |
| -} |
62 |
| -``` |
63 |
| - |
64 |
| -## Overview |
65 |
| - |
66 |
| -This project is a port of [mauricio/postgresql-async](https://github.com/mauricio/postgresql-async) to Kotlin. |
67 |
| -Why? Because the original lib is not maintained anymore, We use it in [ob1k](https://github.com/outbrain/ob1k), and would like to remove the Scala dependency in ob1k. |
68 |
| - |
69 |
| -If you want information specific to the drivers, check the [PostgreSQL README](postgresql-async/README.md) and the |
70 |
| -[MySQL README](mysql-async/README.md). |
71 |
| - |
72 |
| -You can view the project's change log [here](CHANGELOG.md). |
73 |
| - |
74 |
| -**Follow us on twitter: [@jasyncs](https://twitter.com/Jasyncs).** |
75 |
| - |
76 |
| -#### DateTime: |
77 |
| -Version 1.x always returns [JodaTime](http://joda-time.sourceforge.net/) when dealing with date types and not the |
78 |
| -`java.util.Date` class nor jdk-8 dates. |
79 |
| -Version 2.x works with java 8 DateTime objects (`java.time.LocalDateTime` and such). |
80 |
| -This [post](https://blog.joda.org/2014/11/converting-from-joda-time-to-javatime.html) can help with migration. |
81 |
| - |
82 |
| -## Who is using it |
83 |
| - |
84 |
| -* [R2DBC](https://r2dbc.io/) |
85 |
| -* [Spring Data R2DBC](https://spring.io/projects/spring-data-r2dbc) |
86 |
| -* [Vert.x](https://github.com/vert-x3/vertx-mysql-postgresql-client) |
87 |
| -* [micronaut](https://github.com/micronaut-projects/micronaut-sql) |
88 |
| -* [Outbrain/ob1k-db](https://github.com/outbrain/ob1k/) |
89 |
| -* https://github.com/humb1t/jpom |
90 |
| -* [Zeko Data Mapper](https://github.com/darkredz/Zeko-Data-Mapper) and [Zeko SQL Builder](https://github.com/darkredz/Zeko-SQL-Builder) |
91 |
| -* [vertx-jooq async module](https://github.com/jklingsporn/vertx-jooq) |
92 |
| -* [ScalikeJDBC Async](https://github.com/scalikejdbc/scalikejdbc-async) |
93 |
| -* [Quill](https://getquill.io/) |
94 |
| -* [Jasync SQL Extensions](https://github.com/28Smiles/jasync-sql-extensions) |
95 |
| - |
96 |
| -Add your name here! |
97 |
| - |
98 |
| -Is it used in production on large scale? |
99 |
| - |
100 |
| -<img width="550" alt="jasync-sql-production" src="resources/production.png" style="max-width:100%;"> |
101 |
| - |
102 |
| -The graph above is from only couple of services using it. Y-Axis is # of queries per minute. |
103 |
| - |
104 |
| -There is also a [TechEmpower test](https://github.com/TechEmpower/FrameworkBenchmarks/pull/4247) using `ktor` and `jasync-sql`. |
105 |
| - |
106 |
| -[Zeko SQL Builder](https://github.com/darkredz/Zeko-SQL-Builder#performance) compared jasync to hikary and vertex: |
107 |
| -<img width="550" alt="jasync-sql-zeko" src="https://github.com/darkredz/Zeko-SQL-Builder/blob/master/zeko-sql-builder-benchmark.jpeg" style="max-width:100%;"> |
108 |
| - |
109 |
| - |
110 |
| -## Support |
111 |
| - |
112 |
| -* Check [FAQ](https://github.com/jasync-sql/jasync-sql/wiki/FAQ) or [Known Issues](https://github.com/jasync-sql/jasync-sql/wiki/Known-Issues) or [google](https://www.google.com/search?q=jasync-sql). |
113 |
| -* Open an issue here: https://github.com/jasync-sql/jasync-sql/issues |
114 |
| -* Chat on gitter: https://gitter.im/jasync-sql/support |
115 |
| -* Ask a question in StackOverflow with [jasync-sql](https://stackoverflow.com/questions/tagged/jasync-sql) tag. |
116 |
| - |
117 |
| -## More links |
118 |
| - |
119 |
| -* [How we cloned the original lib](https://hackernoon.com/how-i-ported-10k-lines-of-scala-to-kotlin-in-one-week-c645732d3c1). |
120 |
| -* https://github.com/mauricio/postgresql-async - The original (deprecated) lib. |
121 |
| -* [Async database access with MySQL, Kotlin and jasync-sql](https://medium.com/@OhadShai/async-database-access-with-mysql-kotlin-and-jasync-sql-dbfdb8e7fd04). |
122 |
| -* [Issue with NUMERIC](https://medium.com/@OhadShai/sometimes-a-small-bug-fix-can-lead-to-an-avalanche-f6ded2ecf53d). |
123 |
| -* [jasync-sql + javalin example](https://medium.com/@OhadShai/reactive-java-all-the-way-to-the-database-with-jasync-sql-and-javalin-c982365d7dd2). |
124 |
| -* [jasync-sql + ktor + coroutines example](https://medium.com/@OhadShai/async-with-style-kotlin-web-backend-with-ktor-coroutines-and-jasync-mysql-b34e8c83e4bd). |
125 |
| -* [jasync-sql + spring + kotlin example](https://github.com/godpan/spring-kotlin-jasync-sql). |
126 |
| -* [How to implement an Object Pool with an Actor in Kotlin](https://medium.freecodecamp.org/how-to-implement-an-object-pool-with-an-actor-in-kotlin-ed06d3ba6257). |
127 |
| -* [Coroutines usage](https://medium.com/@OhadShai/just-a-small-example-of-how-kotlin-coroutines-are-great-c9774fe8434). |
128 |
| -* [Spring Data R2DBC video](https://www.youtube.com/watch?v=DvO4zLVDkMs). |
129 |
| -* [JDBC for Spring WebFlux: Spring Data R2DBC](https://medium.com/w-logs/jdbc-for-spring-webflux-spring-data-r2dbc-99690208cfeb). |
130 |
| -* [Spring WebFlux는 어떻게 적은 리소스로 많은 트래픽을 감당할까?](https://alwayspr.tistory.com/44). |
131 |
| - |
132 |
| - |
133 |
| -## Contributing |
134 |
| - |
135 |
| -Pull requests are welcome! |
136 |
| -See [CONTRIBUTING](CONTRIBUTING.md). |
| 2 | +# This is a fork of [jasync-sql](https://github.com/jasync-sql/jasync-sql) |
0 commit comments