Method: Sequel::SQL::Builders#cast_numeric

Defined in:
lib/sequel/sql.rb

#cast_numeric(arg, sql_type = nil) ⇒ Object

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, so you can use the bitwise operators on the result.

Sequel.cast_numeric(:a) # CAST(a AS integer)
Sequel.cast_numeric(:a, Float) # CAST(a AS double precision)


389
390
391
# File 'lib/sequel/sql.rb', line 389

def cast_numeric(arg, sql_type = nil)
  cast(arg, sql_type || Integer).sql_number
end