module DB::SessionMethods(Session, Stmt)
Overview
Methods that are shared accross session like objects:
- Database
- Connection
Classes that includes this module are able to execute queries and statements in both prepared and unprepared fashion.
This module serves for dsl reuse over session like objects.
Included Modules
Direct including types
Defined in:
db/session_methods.crInstance Method Summary
-
#build(query) : Stmt
:nodoc:
- #build_unprepared_statement(query) : Stmt
- #fetch_or_build_prepared_statement(query) : Stmt
-
#prepared(query)
Returns a prepared
Statement
that has not been executed yet. -
#prepared
dsl helper to build prepared statements returns a value that includes
QueryMethods
-
#prepared_statements? : Bool
Returns whether by default the statements should be prepared or not.
-
#unprepared(query)
Returns an unprepared
Statement
that has not been executed yet. -
#unprepared
dsl helper to build unprepared statements returns a value that includes
QueryMethods
Instance methods inherited from module DB::QueryMethods(Stmt)
exec(query, *args_, args : Array | Nil = nil)
exec,
query(query, *args_, args : Array | Nil = nil)query(query, *args_, args : Array | Nil = nil, &) query, query_all(query, *args_, args : Array | Nil = nil, &block : ResultSet -> U) : Array(U) forall U
query_all(query, *args_, args : Array | Nil = nil, as types : Tuple)
query_all(query, *args_, args : Array | Nil = nil, as types : NamedTuple)
query_all(query, *args_, args : Array | Nil = nil, as type : Class) query_all, query_each(query, *args_, args : Array | Nil = nil, &) query_each, query_one(query, *args_, args : Array | Nil = nil, &block : ResultSet -> U) : U forall U
query_one(query, *args_, args : Array | Nil = nil, as types : Tuple)
query_one(query, *args_, args : Array | Nil = nil, as types : NamedTuple)
query_one(query, *args_, args : Array | Nil = nil, as type : Class) query_one, query_one?(query, *args_, args : Array | Nil = nil, &block : ResultSet -> U) : U | Nil forall U
query_one?(query, *args_, args : Array | Nil = nil, as types : Tuple)
query_one?(query, *args_, args : Array | Nil = nil, as types : NamedTuple)
query_one?(query, *args_, args : Array | Nil = nil, as type : Class) query_one?, scalar(query, *args_, args : Array | Nil = nil) scalar
Instance Method Detail
abstract
def prepared_statements? : Bool
#
Returns whether by default the statements should be prepared or not.
def unprepared
#
dsl helper to build unprepared statements
returns a value that includes QueryMethods