Creates a connection, managed with given handler.
Creates a connection, managed with given handler.
connection handler
connection properties
a new Acolyte connection
connection(handler) // without connection properties // With connection property to fallback untyped null connection(handler, "acolyte.parameter.untypedNull" -> "true")
Creates a connection, whose statement will be passed to given handler.
Creates a connection, whose statement will be passed to given handler.
statement handler
connection properties
a new Acolyte connection
connection(handler) // without connection properties // With connection property to fallback untyped null connection(handler, "acolyte.parameter.untypedNull" -> "true")
Manages a scope to debug any JDBC execution
Manages a scope to debug any JDBC execution
the operation to print any QueryExecution that occurs within the scope of debuging.
the function working with the debug connection.
import acolyte.jdbc.AcolyteDSL AcolyteDSL.debuging() { con => val stmt = con.prepareStatement("SELECT * FROM Test WHERE id = ?") stmt.setString(1, "foo") stmt.executeQuery() } // print on stdout: "Executed query: QueryExecution(SELECT * FROM Test WHERE id = ?,List(Param(foo, VARCHAR)))"
Creates a new handler detecting all statements as queries
(like handleStatement.withQueryDetection(".*").withQueryHandler(h)
).
Creates a new handler detecting all statements as queries
(like handleStatement.withQueryDetection(".*").withQueryHandler(h)
).
import acolyte.jdbc.AcolyteDSL.{ connection, handleQuery } connection { handleQuery { _ => res }
Creates an empty handler.
Creates an empty handler.
import acolyte.jdbc.AcolyteDSL.{ connection, handleStatement }
connection { handleStatement }
Returns an update result with row |count| and generated |keys|.
Returns an update result with row |count| and generated |keys|.
Updated (row) count
Generated keys
import acolyte.jdbc.AcolyteDSL.updateResult import acolyte.jdbc.RowLists updateResult(2/* updated rows */, RowLists.stringList("a", "b"))
Executes |f| using connection accepting only queries, and answering with |result| to any query.
Executes |f| using connection accepting only queries, and answering with |result| to any query.
import acolyte.jdbc.AcolyteDSL.withQueryResult val str: String = withQueryResult(queryRes) { con => "str" }
Acolyte DSL for JDBC.