DB::Statement
Inherits DB::Disposable / DB::StatementMethods / Reference / Object
Represents a query in a Connection.
It should be created by QueryMethods.
Note to implementors
- Subclass
Statements Statementsare created from a custom driverConnection#preparemethod.#perform_queryexecutes a query that is expected to return aResultSet#perform_execexecutes a query that is expected to return anExecResult#do_closeis called to release the statement resources.
Constructors
Instance methods
command
Sourcerelease_connection
SourceMacros
def_around_query_or_exec
This macro allows injecting code to be run before and after the execution
of the request. It should return the yielded value. It must be called with 1
block argument that will be used to pass the args : Enumerable.
class DB::Statement
def_around_query_or_exec do |args|
# do something before query or exec
res = yield
# do something after query or exec
res
end
end