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
129 130 131 |
# File 'lib/hanami/model/sql.rb', line 129 def self.asc(column) Sequel.asc(column) end |
.desc(column) ⇒ String
Returns SQL fragment for descending order for the given column
139 140 141 |
# File 'lib/hanami/model/sql.rb', line 139 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
85 86 87 |
# File 'lib/hanami/model/sql.rb', line 85 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
119 120 121 |
# File 'lib/hanami/model/sql.rb', line 119 def self.literal(string) Sequel.lit(string) end |