module Sequel::SQL::QualifyingMethods

Includes a qualify and [] methods that create QualifiedIdentifiers, 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

*(ce=(arg=false;nil)) click to toggle source

If no arguments are given, return an SQL::ColumnAll:

Sequel[:a].*  # a.*
Calls superclass method
    # File lib/sequel/sql.rb
919 def *(ce=(arg=false;nil))
920   if arg == false
921     Sequel::SQL::ColumnAll.new(self)
922   else
923     super(ce)
924   end
925 end
[](identifier) click to toggle source

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"
    # File lib/sequel/sql.rb
941 def [](identifier)
942   QualifiedIdentifier.new(self, identifier)
943 end
qualify(qualifier) click to toggle source

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"
    # File lib/sequel/sql.rb
932 def qualify(qualifier)
933   QualifiedIdentifier.new(qualifier, self)
934 end