Method: Sequel::SQL::CastMethods#cast

Defined in:
lib/sequel/sql.rb

#cast(sql_type) ⇒ Object

Cast the reciever to the given SQL type. You can specify a ruby class as a type, and it is handled similarly to using a database independent type in the schema methods.

Sequel.function(:func).cast(:integer) # CAST(func() AS integer)
Sequel.function(:func).cast(String) # CAST(func() AS varchar(255))


695
696
697
# File 'lib/sequel/sql.rb', line 695

def cast(sql_type)
  Cast.new(self, sql_type)
end