- All Known Subinterfaces:
SqlClient
,TransactionalSqlOperations
- All Known Implementing Classes:
io.inverno.mod.sql.vertx.internal.AbstractSqlClient
,io.inverno.mod.sql.vertx.internal.AbstractSqlOperations
,ConnectionSqlClient
,PooledClientSqlClient
,PoolSqlClient
Specifies basic reactive SQL operations
- Since:
- 1.2
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptionbatchUpdate
(String sql, List<Object[]> args) Executes multiple update operations in a batch using the specified list of arguments and returns the number rows affected by the operation.batchUpdate
(String sql, Stream<Object[]> args) Executes multiple update operations in a batch using the specified stream of arguments and returns the number rows affected by the operation.preparedStatement
(String sql) Creates a prepared SQL statement.Executes a query operation using a prepared statement with the specified arguments and returns the resulting rows.<T> Publisher
<T> Executes a query operation using a prepared statement with the specified arguments, applies a row mapping function to the resulting rows and returns the results.<T> Mono
<T> queryForObject
(String sql, Function<Row, T> rowMapper, Object... args) Executes a query operation using a prepared statement with the specified arguments, maps a single row to an object using a row mapping function and return that object.Creates a SQL statement.Executes an update operation such as insert, update or delete using a prepared statement with the specified arguments and returns the number rows affected by the operation.
-
Method Details
-
statement
Creates a SQL statement.
- Parameters:
sql
- the static SQL to execute- Returns:
- a new statement
-
preparedStatement
Creates a prepared SQL statement.
Prepared statements are pre-compiled and protect against SQL injection attacks.
- Parameters:
sql
- the SQL to execute- Returns:
- a new prepared statement
-
query
Executes a query operation using a prepared statement with the specified arguments and returns the resulting rows.
- Parameters:
sql
- the SQL query to executeargs
- the query arguments- Returns:
- a publisher of rows
-
query
Executes a query operation using a prepared statement with the specified arguments, applies a row mapping function to the resulting rows and returns the results.
- Type Parameters:
T
- the type of results- Parameters:
sql
- the SQL query to executerowMapper
- a row mapping functionargs
- the query arguments- Returns:
- a publisher of results
-
queryForObject
Executes a query operation using a prepared statement with the specified arguments, maps a single row to an object using a row mapping function and return that object.
- Type Parameters:
T
- The type of the resulting object- Parameters:
sql
- the SQL query to executerowMapper
- a row mapping functionargs
- the query arguments- Returns:
- a Mono emitting the result
-
update
Executes an update operation such as insert, update or delete using a prepared statement with the specified arguments and returns the number rows affected by the operation.
- Parameters:
sql
- the SQL update to executeargs
- the update arguments- Returns:
- a Mono emitting the number of rows affected by the operation
-
batchUpdate
Executes multiple update operations in a batch using the specified list of arguments and returns the number rows affected by the operation.
- Parameters:
sql
- the SQL update to executeargs
- a list of arguments- Returns:
- a Mono emitting the number of rows affected by the batch operation
-
batchUpdate
Executes multiple update operations in a batch using the specified stream of arguments and returns the number rows affected by the operation.
- Parameters:
sql
- the SQL update to executeargs
- a stream of arguments- Returns:
- a Mono emitting the number of rows affected by the batch operation
-