module Sequel::SQL::QualifyingMethods
Includes a qualify
and []
methods that create QualifiedIdentifier
s, used for qualifying column names with a table or table names with a schema, and the * method for returning all columns in the identifier if no arguments are given.
Public Instance Methods
Source
# File lib/sequel/sql.rb 924 def *(ce=(arg=false;nil)) 925 if arg == false 926 Sequel::SQL::ColumnAll.new(self) 927 else 928 super(ce) 929 end 930 end
If no arguments are given, return an SQL::ColumnAll
:
Sequel[:a].* # a.*
Calls superclass method
Source
# File lib/sequel/sql.rb 946 def [](identifier) 947 QualifiedIdentifier.new(self, identifier) 948 end
Qualify the receiver with the given qualifier
(table for column/schema for table).
Sequel[:table][:column] # "table"."column" Sequel[:schema][:table] # "schema"."table" Sequel[:schema][:table][:column] # "schema"."table"."column"
Source
# File lib/sequel/sql.rb 937 def qualify(qualifier) 938 QualifiedIdentifier.new(qualifier, self) 939 end
Qualify the receiver with the given qualifier
(table for column/schema for table).
Sequel[:column].qualify(:table) # "table"."column" Sequel[:table].qualify(:schema) # "schema"."table" Sequel.qualify(:table, :column).qualify(:schema) # "schema"."table"."column"