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:

db/session_methods.cr

Instance Method Summary

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

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

def build(query) : Stmt #

[View source]
abstract def build_unprepared_statement(query) : Stmt #

[View source]
abstract def fetch_or_build_prepared_statement(query) : Stmt #

[View source]
def prepared(query) #

Returns a prepared Statement that has not been executed yet.


[View source]
def prepared #

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


[View source]
abstract def prepared_statements? : Bool #

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


[View source]
def unprepared(query) #

Returns an unprepared Statement that has not been executed yet.


[View source]
def unprepared #

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


[View source]