class

Granite::Adapter::Mysql

Inherits Granite::Adapter::Base < Reference < Object

Mysql implementation of the Adapter

Constants

QUOTING_CHAR = '`'

Class methods

schema_type?(key : String) : String | Nil

converts the crystal class to database type of this adapter

Source

Instance methods

clear(table_name : String)

Using TRUNCATE instead of DELETE so the id column resets to 0

Source
delete(table_name : String, primary_name : String, value)

This will delete a row from the database.

Source
import(table_name : String, primary_name : String, auto : Bool, fields, model_array, **options)

This will insert an array of models as one insert statement

Source
insert(table_name : String, fields, params, lastval) : Int64

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

Source
quote(name : String) : String

quotes table and column names

Source
update(table_name : String, primary_name : String, fields, params)

This will update a row in the database.

Source

Nested types