module Guff class Model getter :db def initialize(@models : Models, @templates : TemplateCache) @db = TemplateDatabase.new(@models.db, @templates) end def one( key : Symbol, args : Array(String) | Hash(String, String) | Nil, tmpl_args : Hash(String, String) | Nil ) @db.one(key, args, tmpl_args) end def row( key : Symbol, args : Array(String) | Hash(String, String) | Nil, tmpl_args : Hash(String, String) | Nil ) @db.row(key, args, tmpl_args) end def all( key : Symbol, args : Array(String) | Hash(String, String) | Nil, tmpl_args : Hash(String, String) | Nil, &block : Hash(String, ::SQLite3::Value) -> \ ) @db.all(key, args, tmpl_args, &block) end def query( key : Symbol, args : Array(String) | Hash(String, String) | Nil, tmpl_args : Hash(String, String) | Nil ) @db.query(key, args, tmpl_args) end def transaction(&block) @db.transaction(&block) end def template( key : Symbol, args : Hash(String, String) | Nil ) @db.template(key, args) end def last_insert_row_id @db.last_insert_row_id end end end