abstract class Focus::Database

Direct Known Subclasses

Defined in:

focus/database.cr

Constructors

Instance Method Summary

Constructor Detail

def self.connect(url : String) : Database #

[View source]
def self.connect(db : DB::Database) : Database #

[View source]
def self.new(raw_db : DB::Database) #

[View source]

Instance Method Detail

def close : Nil #

[View source]
def delete(table : Focus::Table, where : ColumnDeclaring(Bool)) : Int64 #

[View source]
def delete_all(table : Focus::Table) : Int64 #

[View source]
abstract def execute_insert_and_return_generated_key(expression : Focus::InsertExpression, column : Focus::BaseColumn) : DB::ResultSet #

[View source]
def execute_query(expression : Focus::SqlExpression) : DB::ResultSet #

[View source]
def execute_update(expression : Focus::SqlExpression) : Int64 #

[View source]
abstract def format_expression(expression : Focus::SqlExpression) : Tuple(String, Array(Focus::BaseArgumentExpression)) #

[View source]
def from(table : Focus::Table) : Focus::QuerySource #

[View source]
def insert(table : Focus::Table, &) : Int64 #

[View source]
def insert_returning_generated_key(table : Focus::Table, column : Focus::Column(T), &) : T forall T #

[View source]
def setup_connection(&block : DB::Connection -> _) #

[View source]
def update(table : Focus::Table, &) : Int64 #

[View source]
def with_connection(&block : DB::Connection -> T) : T forall T #

[View source]
def with_transaction(&block : DB::Transaction -> T) : T | Nil forall T #

[View source]