class Granite::Adapter::Sqlite

Overview

Sqlite implementation of the Adapter

Defined in:

adapter/sqlite.cr

Constant Summary

QUOTING_CHAR = '"'

Class Method Summary

Instance Method Summary

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

clear(table_name : String) clear, database : DB::Database database, delete(table_name : String, primary_name : String, value) delete, exists?(table_name : String, criteria : String, params = [] of Granite::Columns::Type) : Bool exists?, import(table_name : String, primary_name : String, auto : Bool, fields, model_array, **options) import, insert(table_name : String, fields, params, lastval) : Int64 insert, log(query : String, elapsed_time : Time::Span, params = [] of String) : Nil log, name : String name, open(&) open, select(query : Granite::Select::Container, clause = "", params = [] of DB::Any, &) select, update(table_name : String, primary_name : String, fields, params) update, url : String url

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

new(name : String, url : String) new

Class Method Detail

def self.schema_type?(key : String) : String | Nil #

converts the crystal class to database type of this adapter


[View source]

Instance Method Detail

def clear(table_name : String) #

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


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

This will delete a row from the database.


[View source]
def import(table_name : String, primary_name : String, auto : Bool, fields, model_array, **options) #
Description copied from class Granite::Adapter::Base

This will insert an array of models as one insert statement


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

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


[View source]
def quote(name : String) : String #

quotes table and column names


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

This will update a row in the database.


[View source]