class Granite::Adapter::Mysql
- Granite::Adapter::Mysql
- Granite::Adapter::Base
- Reference
- Object
Overview
Mysql implementation of the Adapter
Defined in:
adapter/mysql.crConstant Summary
-
QUOTING_CHAR =
'`'
Class Method Summary
-
.schema_type?(key : String) : String | Nil
converts the crystal class to database type of this adapter
Instance Method Summary
-
#clear(table_name : String)
Using TRUNCATE instead of DELETE so the id column resets to 0
-
#delete(table_name : String, primary_name : String, value)
This will delete a row from the database.
-
#import(table_name : String, primary_name : String, auto : Bool, fields, model_array, **options)
This will insert an array of models as one insert statement
-
#insert(table_name : String, fields, params, lastval) : Int64
This will insert a row in the database and return the id generated.
-
#quote(name : String) : String
quotes table and column names
-
#update(table_name : String, primary_name : String, fields, params)
This will update a row in the database.
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
Instance Method Detail
def delete(table_name : String, primary_name : String, value)
#
This will delete a row from the database.
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
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.
def update(table_name : String, primary_name : String, fields, params)
#
This will update a row in the database.