Using connections
When you need to execute sequential queries (without a transaction), you can create a new connection or borrow one from the pool:
Code not translatable
Prepared queries can be created:
connection.prepare("SELECT * FROM users WHERE first_name LIKE $1", { ar1 ->
if (ar1.succeeded()) {
def pq = ar1.result()
pq.query().execute(Tuple.of("andy"), { ar2 ->
if (ar2.succeeded()) {
// All rows
def rows = ar2.result()
}
})
}
})