Module | Sequel::SQL::CastMethods |
In: |
lib/sequel/deprecated.rb
lib/sequel/sql.rb |
# File lib/sequel/deprecated.rb, line 288 288: def cast_as(sql_type) 289: Sequel::Deprecation.deprecate('Sequel::SQL::CastMethods#cast_as', 'Use Sequel::SQL::CastMethods#cast') 290: cast(sql_type) 291: end
Cast the reciever to the given SQL type (or the database‘s default integer type if none given), and return the result as a NumericExpression.
# File lib/sequel/sql.rb, line 181 181: def cast_numeric(sql_type = nil) 182: cast(sql_type || Integer).sql_number 183: end
Cast the reciever to the given SQL type (or the database‘s default string type if none given), and return the result as a StringExpression, so you can use + directly on the result for SQL string concatenation.
# File lib/sequel/sql.rb, line 188 188: def cast_string(sql_type = nil) 189: cast(sql_type || String).sql_string 190: end