Skip to content

Commit

Permalink
Fix regression where id's are not returned by default
Browse files Browse the repository at this point in the history
  • Loading branch information
pmlopes committed Dec 4, 2017
1 parent ac83b39 commit 14aa549
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/main/asciidoc/groovy/index.adoc
Expand Up @@ -14,15 +14,15 @@ To use this project, add the following dependency to the _dependencies_ section
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-jdbc-client</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</dependency>
----

* Gradle (in your `build.gradle` file):
[source,groovy,subs="+attributes"]
----
compile 'io.vertx:vertx-jdbc-client:3.5.0'
compile 'io.vertx:vertx-jdbc-client:3.5.1-SNAPSHOT'
----

== Creating a the client
Expand Down
4 changes: 2 additions & 2 deletions src/main/asciidoc/java/index.adoc
Expand Up @@ -14,15 +14,15 @@ To use this project, add the following dependency to the _dependencies_ section
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-jdbc-client</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</dependency>
----

* Gradle (in your `build.gradle` file):
[source,groovy,subs="+attributes"]
----
compile 'io.vertx:vertx-jdbc-client:3.5.0'
compile 'io.vertx:vertx-jdbc-client:3.5.1-SNAPSHOT'
----

== Creating a the client
Expand Down
4 changes: 2 additions & 2 deletions src/main/asciidoc/js/index.adoc
Expand Up @@ -14,15 +14,15 @@ To use this project, add the following dependency to the _dependencies_ section
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-jdbc-client</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</dependency>
----

* Gradle (in your `build.gradle` file):
[source,groovy,subs="+attributes"]
----
compile 'io.vertx:vertx-jdbc-client:3.5.0'
compile 'io.vertx:vertx-jdbc-client:3.5.1-SNAPSHOT'
----

== Creating a the client
Expand Down
4 changes: 2 additions & 2 deletions src/main/asciidoc/kotlin/index.adoc
Expand Up @@ -14,15 +14,15 @@ To use this project, add the following dependency to the _dependencies_ section
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-jdbc-client</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</dependency>
----

* Gradle (in your `build.gradle` file):
[source,groovy,subs="+attributes"]
----
compile 'io.vertx:vertx-jdbc-client:3.5.0'
compile 'io.vertx:vertx-jdbc-client:3.5.1-SNAPSHOT'
----

== Creating a the client
Expand Down
4 changes: 2 additions & 2 deletions src/main/asciidoc/ruby/index.adoc
Expand Up @@ -14,15 +14,15 @@ To use this project, add the following dependency to the _dependencies_ section
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-jdbc-client</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</dependency>
----

* Gradle (in your `build.gradle` file):
[source,groovy,subs="+attributes"]
----
compile 'io.vertx:vertx-jdbc-client:3.5.0'
compile 'io.vertx:vertx-jdbc-client:3.5.1-SNAPSHOT'
----

== Creating a the client
Expand Down
Expand Up @@ -47,7 +47,7 @@ class JDBCConnectionImpl implements SQLConnection {

private final JDBCStatementHelper helper;

private SQLOptions options;
private SQLOptions options = new SQLOptions().setAutoGeneratedKeys(true);

public JDBCConnectionImpl(Context context, JDBCStatementHelper helper, Connection conn, PoolMetrics metrics, Object metric) {
this.vertx = context.owner();
Expand Down
11 changes: 11 additions & 0 deletions src/test/java/io/vertx/ext/jdbc/JDBCStoredProcedureTest.java
Expand Up @@ -132,6 +132,17 @@ public void testStoredProcedure3() {
await();
}

@Test
public void testReturnIds() {
connection().update("insert into customers(firstname, lastname) values('Paulo', 'Lopes')", onSuccess(updateResult -> {
assertNotNull(updateResult);
assertNotNull(updateResult.getKeys());
assertTrue(updateResult.getKeys().size() > 0);
testComplete();
}));
await();
}

private SQLConnection connection() {
CountDownLatch latch = new CountDownLatch(1);
AtomicReference<SQLConnection> ref = new AtomicReference<>();
Expand Down

0 comments on commit 14aa549

Please sign in to comment.