Module: Hanami::Model::Sql
- Defined in:
- lib/hanami/model/sql.rb,
lib/hanami/model/sql/types.rb,
lib/hanami/model/sql/console.rb,
lib/hanami/model/sql/entity/schema.rb,
lib/hanami/model/sql/consoles/mysql.rb,
lib/hanami/model/sql/consoles/sqlite.rb,
lib/hanami/model/sql/consoles/abstract.rb,
lib/hanami/model/sql/consoles/postgresql.rb,
lib/hanami/model/sql/types/schema/coercions.rb
Overview
SQL adapter
Defined Under Namespace
Modules: Consoles, Entity, Types Classes: Console
Class Method Summary collapse
-
.asc(column) ⇒ String
Returns SQL fragment for ascending order for the given column.
-
.desc(column) ⇒ String
Returns SQL fragment for descending order for the given column.
-
.function(name) ⇒ String
Returns a SQL fragment that references a database function by the given name This is useful for database migrations.
-
.literal(string) ⇒ String
Returns a literal SQL fragment for the given SQL fragment.
Class Method Details
.asc(column) ⇒ String
Returns SQL fragment for ascending order for the given column
127 128 129 |
# File 'lib/hanami/model/sql.rb', line 127 def self.asc(column) Sequel.asc(column) end |
.desc(column) ⇒ String
Returns SQL fragment for descending order for the given column
137 138 139 |
# File 'lib/hanami/model/sql.rb', line 137 def self.desc(column) Sequel.desc(column) end |
.function(name) ⇒ String
Returns a SQL fragment that references a database function by the given name This is useful for database migrations
83 84 85 |
# File 'lib/hanami/model/sql.rb', line 83 def self.function(name) Sequel.function(name) end |
.literal(string) ⇒ String
Returns a literal SQL fragment for the given SQL fragment. This is useful for database migrations
117 118 119 |
# File 'lib/hanami/model/sql.rb', line 117 def self.literal(string) Sequel.lit(string) end |