Skip to content

Commit efd7f1f

Browse files
authored
Merge pull request #64 from marat-gainullin/java-11
Java 11
2 parents 695fc90 + 9f12f6b commit efd7f1f

File tree

130 files changed

+5509
-3527
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+5509
-3527
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ target/
66
*.iml
77
src/test/java/com/github/pgasync/impl/Heroku.java
88
.repository/
9+
.gradle

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ db.queryRows("select unnest('{ hello, world }'::text[] as message)")
4545

4646
### Creating a Db
4747

48-
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)
48+
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)
4949

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

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

7272
### Transactions
@@ -87,7 +87,7 @@ db.begin()
8787

8888
### Custom data types
8989

90-
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)
90+
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)
9191

9292
```java
9393
class JsonConverter implements Converter<example.Json> {

TODO.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Refactoring
2+
* Add arguments checks to most core methods.
3+
4+
## Tests
5+
* Connection pool failed connections
6+
* Connection pool abandoned waiters
7+
+ Make tests for all message flow scenarios.
8+
+ Errors while validation query processing while getting connection in two cases (pool and plain connectible)
9+
+ Errors while authentication
10+
+ Errors while simple query process
11+
+ Errors while extended query process
12+
+ Multiple result sets test
13+
+ Connection pool statements eviction and duplicated statements
14+
+ Termination process test
15+
+ Prepared statement eviction test
16+
+ Auto rollback transaction review
17+
+ Ssl interaction test
18+
+ Notifications test
19+
+ Transactions general test
20+
+ Connection pool general test
21+
+ Queries pipelining vs errors test

pom.xml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
<name>postgres-async-driver</name>
1616
<description>Asynchronous PostgreSQL Java driver</description>
17-
1817
<url>https://github.com/alaisi/postgres-async-driver</url>
1918
<inceptionYear>2014</inceptionYear>
2019
<developers>
@@ -40,19 +39,14 @@
4039
<url>https://github.com/alaisi/postgres-async-driver/issues</url>
4140
</issueManagement>
4241

43-
<prerequisites>
44-
<maven>3.3</maven>
45-
</prerequisites>
46-
4742
<build>
4843
<plugins>
4944
<plugin>
5045
<groupId>org.apache.maven.plugins</groupId>
5146
<artifactId>maven-compiler-plugin</artifactId>
52-
<version>3.5.1</version>
47+
<version>3.8.0</version>
5348
<configuration>
54-
<source>1.8</source>
55-
<target>1.8</target>
49+
<release>11</release>
5650
</configuration>
5751
</plugin>
5852
<plugin>
@@ -72,13 +66,15 @@
7266
<dependency>
7367
<groupId>io.netty</groupId>
7468
<artifactId>netty-handler</artifactId>
75-
<version>4.1.11.Final</version>
69+
<version>4.1.33.Final</version>
7670
</dependency>
71+
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
7772
<dependency>
78-
<groupId>io.reactivex</groupId>
79-
<artifactId>rxjava</artifactId>
80-
<version>1.3.0</version>
73+
<groupId>javax.xml.bind</groupId>
74+
<artifactId>jaxb-api</artifactId>
75+
<version>2.3.1</version>
8176
</dependency>
77+
8278
<dependency>
8379
<groupId>com.google.code.findbugs</groupId>
8480
<artifactId>annotations</artifactId>
@@ -95,7 +91,7 @@
9591
<dependency>
9692
<groupId>ru.yandex.qatools.embed</groupId>
9793
<artifactId>postgresql-embedded</artifactId>
98-
<version>2.1</version>
94+
<version>2.10</version>
9995
<scope>test</scope>
10096
</dependency>
10197
</dependencies>

src/main/java/com/github/pgasync/ConnectionPool.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/main/java/com/github/pgasync/ConnectionPoolBuilder.java

Lines changed: 0 additions & 148 deletions
This file was deleted.

src/main/java/com/github/pgasync/Db.java

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/main/java/com/github/pgasync/Listenable.java

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/main/java/com/github/pgasync/impl/Oid.java renamed to src/main/java/com/github/pgasync/Oid.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl;
15+
package com.github.pgasync;
1616

1717
/**
1818
* Object identifiers, copied from org.postgresql.core.Oid.
@@ -87,6 +87,10 @@ public enum Oid {
8787
this.id = id;
8888
}
8989

90+
public int getId() {
91+
return id;
92+
}
93+
9094
public static Oid valueOfId(int id) {
9195
for (Oid oid : values()) {
9296
if (oid.id == id) {

src/main/java/com/github/pgasync/impl/PgColumn.java renamed to src/main/java/com/github/pgasync/PgColumn.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,34 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl;
15+
package com.github.pgasync;
1616

1717
/**
1818
* Column index/type pair.
1919
*
2020
* @author Antti Laisi
2121
*/
22-
class PgColumn{
22+
public class PgColumn {
2323

24-
final int index;
25-
final String name;
26-
final Oid type;
24+
private final int index;
25+
private final String name;
26+
private final Oid type;
2727

28-
public PgColumn(int index, String name, Oid type){
28+
public PgColumn(int index, String name, Oid type) {
2929
this.index = index;
3030
this.name = name;
3131
this.type = type;
3232
}
33+
34+
public Oid getType() {
35+
return type;
36+
}
37+
38+
public String getName() {
39+
return name;
40+
}
41+
42+
public int at() {
43+
return index;
44+
}
3345
}

0 commit comments

Comments
 (0)