abstract class Sandstone::Adapter::Base
- Sandstone::Adapter::Base
- Reference
- Object
Overview
The Base Adapter specifies the interface that will be used by the model objects to perform actions against a specific database. Each adapter needs to implement these methods.
Direct Known Subclasses
Defined in:
adapter/base.crConstant Summary
-
DATABASE_YML =
"config/database.yml"
Constructors
Class Method Summary
-
.env(url)
class level method so we can test it
Instance Method Summary
-
#clear(table_name)
remove all rows from a table and reset the counter on the id.
- #database : DB::Database
- #database=(database : DB::Database)
-
#delete(table_name, primary_name, value)
This will delete a row from the database.
-
#insert(table_name, fields, params) : Int64
This will insert a row in the database and return the id generated.
- #log(query : String, params = [] of String) : Nil
- #open(&)
-
#select(table_name, fields, clause = "", params = [] of DB::Any, &block : DB::ResultSet -> )
select performs a query against a table.
- #settings(adapter : String)
-
#update(table_name, primary_name, fields, params)
This will update a row in the database.
Constructor Detail
Class Method Detail
Instance Method Detail
This will insert a row in the database and return the id generated.
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
This will update a row in the database.