class Sandstone::Adapter::Sqlite

Overview

Sqlite implementation of the Adapter

Defined in:

adapter/sqlite.cr

Instance Method Summary

Instance methods inherited from class Sandstone::Adapter::Base

clear(table_name) clear, database : DB::Database database, database=(database : DB::Database) database=, delete(table_name, primary_name, value) delete, insert(table_name, fields, params) : Int64 insert, log(query : String, params = [] of String) : Nil log, open(&) open, select(table_name, fields, clause = "", params = [] of DB::Any, &block : DB::ResultSet -> ) select, settings(adapter : String) settings, update(table_name, primary_name, fields, params) update

Constructor methods inherited from class Sandstone::Adapter::Base

new(adapter : String) new

Class methods inherited from class Sandstone::Adapter::Base

env(url) env

Instance Method Detail

def clear(table_name) #

remove all rows from a table and reset the counter on the id.


[View source]
def delete(table_name, primary_name, value) #

This will delete a row from the database.


[View source]
def insert(table_name, fields, params) : Int64 #
Description copied from class Sandstone::Adapter::Base

This will insert a row in the database and return the id generated.


[View source]
def select(table_name, fields, clause = "", params = [] of DB::Any, &block : DB::ResultSet -> ) #

select performs a query against a table. The table_name and fields are configured using the sql_mapping directive in your model. The clause and params is the query and params that is passed in via .all() method


[View source]
def select_one(table_name, fields, field, id, &) #

select_one is used by the find method.


[View source]
def update(table_name, primary_name, fields, params) #

This will update a row in the database.


[View source]