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
- #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
exec(query, *args)
exec,
query(query, *args)query(query, *args, &block) query, query_all(query, *args, as type : Class)
query_all(query, *args, as types : NamedTuple)
query_all(query, *args, &block : ResultSet -> U) : Array(U) forall U
query_all(query, *args, as types : Tuple) query_all, query_each(query, *args, &block) query_each, query_one(query, *args, &block : ResultSet -> U) : U forall U
query_one(query, *args, as types : Tuple)
query_one(query, *args, as types : NamedTuple)
query_one(query, *args, as type : Class) query_one, query_one?(query, *args, as type : Class)
query_one?(query, *args, as types : NamedTuple)
query_one?(query, *args, as types : Tuple)
query_one?(query, *args, &block : ResultSet -> U) : U? forall U query_one?, scalar(query, *args) 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