use of io.vertx.mutiny.sqlclient.RowSet in project smallrye-mutiny-vertx-bindings by smallrye.
the class PostGreSQLClientTest method testSequence.
@Test
public void testSequence() {
PgConnectOptions options = new PgConnectOptions().setPort(container.getMappedPort(5432)).setHost(container.getContainerIpAddress()).setDatabase(container.getDatabaseName()).setUser(container.getUsername()).setPassword(container.getPassword());
Pool client = PgPool.pool(vertx, options, new PoolOptions().setMaxSize(5));
Uni<Tuple2<RowSet<Row>, RowSet<Row>>> uni = client.getConnection().flatMap(c -> Uni.combine().all().unis(c.preparedQuery("SELECT 1").execute(), c.preparedQuery("SELECT 1").execute()).asTuple());
Tuple2<RowSet<Row>, RowSet<Row>> results = uni.await().indefinitely();
assertThat(results).isNotNull();
assertThat(results.size()).isEqualTo(2);
assertThat(results.getItem1()).isNotNull();
assertThat(results.getItem2()).isNotNull();
}
use of io.vertx.mutiny.sqlclient.RowSet in project smallrye-mutiny-vertx-bindings by smallrye.
the class DB2ClientTest method testSequence.
@Test
public void testSequence() {
DB2ConnectOptions options = new DB2ConnectOptions().setPort(container.getMappedPort(50000)).setHost(container.getContainerIpAddress()).setDatabase(container.getDatabaseName()).setUser(container.getUsername()).setPassword(container.getPassword());
Pool client = DB2Pool.pool(vertx, options, new PoolOptions().setMaxSize(5));
Uni<Tuple2<RowSet<Row>, RowSet<Row>>> uni = client.getConnection().flatMap(c -> Uni.combine().all().unis(c.preparedQuery("SELECT 1 FROM SYSIBM.SYSDUMMY1").execute(), c.preparedQuery("SELECT 1 FROM SYSIBM.SYSDUMMY1").execute()).asTuple());
Tuple2<RowSet<Row>, RowSet<Row>> results = uni.await().indefinitely();
assertThat(results).isNotNull();
assertThat(results.size()).isEqualTo(2);
assertThat(results.getItem1()).isNotNull();
assertThat(results.getItem2()).isNotNull();
}
Aggregations