Skip to content
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

UpdateResult getKeys method is retuning empty #167

Open
jgutierreznab opened this issue Nov 24, 2019 · 2 comments
Open

UpdateResult getKeys method is retuning empty #167

jgutierreznab opened this issue Nov 24, 2019 · 2 comments

Comments

@jgutierreznab
Copy link

Hi guys, first, thank you so much for this amazing framework.

updateWithParams UpdateResult getKeys methods is returning an empty array, not sure if this is important => vert-x3/vertx-jdbc-client#113 from 2017

I'm currently under <vertx.version>3.8.3</vertx.version>

     <dependency>
	 <groupId>io.vertx</groupId>
	 <artifactId>vertx-mysql-postgresql-client</artifactId>
	</dependency>

connection type is SQLConnection

String execQuery = "INSERT INTO users(username, email, password) VALUES (?, ?, ?) RETURNING (id)";

the query is valid and is inserting properly in the Pg table

connection.updateWithParams(execQuery, queryParams, h -> {
  if (h.succeeded()) {
							
	 UpdateResult result = h.result();
	 System.out.println("result.getUpdated() => " + result.getKeys());
	
        someFuture.complete(result.getKeys().getValue(0));
	connection.close();
 }
})

also tried with .setOptions(new SQLOptions().setAutoGeneratedKeys(true)) with no luck

connection.setOptions(new SQLOptions().setAutoGeneratedKeys(true)).updateWithParams(execQuery, queryParams, h -> {

thank you very much for the amazing work

@garrydias
Copy link

Same problem here.
setAutoGeneratedKeys(true) is unsupported operation and raises an exception.
The version i'm using is 3.8.5.
Is there any workarounds?

@jgutierreznab
Copy link
Author

@garrydias probably using the ReactiveJDBC will solve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants