Skip to content

Java 11 #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Mar 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f2c1817
First refactoring with CompleteableFutures
marat-gainullin Dec 31, 2018
1b4b896
Completable futures added everywhere
marat-gainullin Jan 8, 2019
42a5a75
JavaDoc reviewed
marat-gainullin Jan 9, 2019
e4d6243
Maximum variables made private
marat-gainullin Jan 9, 2019
34df290
Tests refactored according to CompletableFuture approach
marat-gainullin Jan 11, 2019
9cb7d18
Authentication test pass
marat-gainullin Jan 12, 2019
974418c
Most tests fixed
marat-gainullin Jan 15, 2019
86b7b86
Test plan updated
marat-gainullin Jan 16, 2019
433fb51
Connection pool closing fixed
marat-gainullin Jan 16, 2019
4aba4af
Refactoring of conversions
marat-gainullin Jan 16, 2019
5cb5ec8
Packages restructured
marat-gainullin Jan 16, 2019
af41d44
Packages structure refactoreed
marat-gainullin Jan 16, 2019
cef86fa
Performance test fixed
marat-gainullin Jan 16, 2019
e318d07
Performance test fixed
marat-gainullin Jan 17, 2019
25ed16f
Describe is sent only once
marat-gainullin Jan 17, 2019
5353239
Performance test refactored
marat-gainullin Jan 20, 2019
dfefb4d
Single prepended connection and statement
marat-gainullin Jan 21, 2019
660e94e
Connection pool utilization added to performance test
marat-gainullin Jan 21, 2019
5c4b37f
Threads count variance restored in performance test
marat-gainullin Jan 21, 2019
0e06eb2
Parse & Sync and Close & Sync
marat-gainullin Jan 21, 2019
4235468
Refactoring of interfaces
marat-gainullin Feb 2, 2019
85b97ce
Refactoring of EventGroup using
marat-gainullin Feb 6, 2019
9f12f6b
Fixed name sequence of prepared statements bug
marat-gainullin Feb 14, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ target/
*.iml
src/test/java/com/github/pgasync/impl/Heroku.java
.repository/
.gradle
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ db.queryRows("select unnest('{ hello, world }'::text[] as message)")

### Creating a Db

Db is a connection pool that is created with [`com.github.pgasync.ConnectionPoolBuilder`](https://github.com/alaisi/postgres-async-driver/blob/master/src/main/java/com/github/pgasync/ConnectionPoolBuilder.java)
Db is a connection pool that is created with [`ConnectionPoolBuilder`](https://github.com/alaisi/postgres-async-driver/blob/master/src/main/java/com/github/pgasync/ConnectionPoolBuilder.java)

```java
Db db = new ConnectionPoolBuilder()
Expand All @@ -66,7 +66,7 @@ Prepared statements use native PostgreSQL syntax `$index`. Supported parameter t

```java
db.querySet("insert into message(id, body) values($1, $2)", 123, "hello")
.subscribe(result -> out.printf("Inserted %d rows", result.updatedRows() ));
.subscribe(result -> out.printf("Inserted %d rows", result.affectedRows() ));
```

### Transactions
Expand All @@ -87,7 +87,7 @@ db.begin()

### Custom data types

Support for additional data types requires registering converters to [`com.github.pgasync.ConnectionPoolBuilder`](https://github.com/alaisi/postgres-async-driver/blob/master/src/main/java/com/github/pgasync/ConnectionPoolBuilder.java)
Support for additional data types requires registering converters to [`ConnectionPoolBuilder`](https://github.com/alaisi/postgres-async-driver/blob/master/src/main/java/com/github/pgasync/ConnectionPoolBuilder.java)

```java
class JsonConverter implements Converter<example.Json> {
Expand Down
21 changes: 21 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Refactoring
* Add arguments checks to most core methods.

## Tests
* Connection pool failed connections
* Connection pool abandoned waiters
+ Make tests for all message flow scenarios.
+ Errors while validation query processing while getting connection in two cases (pool and plain connectible)
+ Errors while authentication
+ Errors while simple query process
+ Errors while extended query process
+ Multiple result sets test
+ Connection pool statements eviction and duplicated statements
+ Termination process test
+ Prepared statement eviction test
+ Auto rollback transaction review
+ Ssl interaction test
+ Notifications test
+ Transactions general test
+ Connection pool general test
+ Queries pipelining vs errors test
22 changes: 9 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

<name>postgres-async-driver</name>
<description>Asynchronous PostgreSQL Java driver</description>

<url>https://github.com/alaisi/postgres-async-driver</url>
<inceptionYear>2014</inceptionYear>
<developers>
Expand All @@ -40,19 +39,14 @@
<url>https://github.com/alaisi/postgres-async-driver/issues</url>
</issueManagement>

<prerequisites>
<maven>3.3</maven>
</prerequisites>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>11</release>
</configuration>
</plugin>
<plugin>
Expand All @@ -72,13 +66,15 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.1.11.Final</version>
<version>4.1.33.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>1.3.0</version>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
Expand All @@ -95,7 +91,7 @@
<dependency>
<groupId>ru.yandex.qatools.embed</groupId>
<artifactId>postgresql-embedded</artifactId>
<version>2.1</version>
<version>2.10</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
42 changes: 0 additions & 42 deletions src/main/java/com/github/pgasync/ConnectionPool.java

This file was deleted.

148 changes: 0 additions & 148 deletions src/main/java/com/github/pgasync/ConnectionPoolBuilder.java

This file was deleted.

16 changes: 0 additions & 16 deletions src/main/java/com/github/pgasync/Db.java

This file was deleted.

12 changes: 0 additions & 12 deletions src/main/java/com/github/pgasync/Listenable.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package com.github.pgasync.impl;
package com.github.pgasync;

/**
* Object identifiers, copied from org.postgresql.core.Oid.
Expand Down Expand Up @@ -87,6 +87,10 @@ public enum Oid {
this.id = id;
}

public int getId() {
return id;
}

public static Oid valueOfId(int id) {
for (Oid oid : values()) {
if (oid.id == id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,34 @@
* limitations under the License.
*/

package com.github.pgasync.impl;
package com.github.pgasync;

/**
* Column index/type pair.
*
* @author Antti Laisi
*/
class PgColumn{
public class PgColumn {

final int index;
final String name;
final Oid type;
private final int index;
private final String name;
private final Oid type;

public PgColumn(int index, String name, Oid type){
public PgColumn(int index, String name, Oid type) {
this.index = index;
this.name = name;
this.type = type;
}

public Oid getType() {
return type;
}

public String getName() {
return name;
}

public int at() {
return index;
}
}
Loading