module DB::SessionMethods(Session, Stmt)

Overview

Methods that are shared accross session like objects:

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:

Instance Method Summary

Instance methods inherited from module DB::QueryMethods(Stmt)

exec(query, *args_, args : Array? = nil) exec, query(query, *args_, args : Array? = nil)
query(query, *args_, args : Array? = nil, &)
query
, query_all(query, *args_, args : Array? = nil, as type : Class)
query_all(query, *args_, args : Array? = nil, as types : NamedTuple)
query_all(query, *args_, args : Array? = nil, &block : ResultSet -> U) : Array(U) forall U
query_all(query, *args_, args : Array? = nil, as types : Tuple)
query_all
, query_each(query, *args_, args : Array? = nil, &) query_each, query_one(query, *args_, args : Array? = nil, &block : ResultSet -> U) : U forall U
query_one(query, *args_, args : Array? = nil, as types : Tuple)
query_one(query, *args_, args : Array? = nil, as types : NamedTuple)
query_one(query, *args_, args : Array? = nil, as type : Class)
query_one
, query_one?(query, *args_, args : Array? = nil, as type : Class)
query_one?(query, *args_, args : Array? = nil, as types : NamedTuple)
query_one?(query, *args_, args : Array? = nil, as types : Tuple)
query_one?(query, *args_, args : Array? = nil, &block : ResultSet -> U) : U? forall U
query_one?
, scalar(query, *args_, args : Array? = nil) scalar

Instance Method Detail

def build(query) : Stmt #
Description copied from module DB::QueryMethods(Stmt)

:nodoc:


abstract def build_unprepared_statement(query) : Stmt #

abstract def fetch_or_build_prepared_statement(query) : Stmt #

def prepared(query) #

Returns a prepared Statement that has not been executed yet.


def prepared #

dsl helper to build prepared statements returns a value that includes QueryMethods


abstract def prepared_statements? : Bool #

Returns whether by default the statements should be prepared or not.


def unprepared(query) #

Returns an unprepared Statement that has not been executed yet.


def unprepared #

dsl helper to build unprepared statements returns a value that includes QueryMethods