Class: Sequel::SQL::QualifiedIdentifier

Inherits:
GenericExpression show all
Defined in:
lib/sequel_core/sql.rb

Overview

Represents a qualified (column with table) reference. Used when joining tables to disambiguate columns.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ComplexExpressionMethods

#extract, #sql_boolean, #sql_number, #sql_string

Methods included from StringMethods

#ilike, #like

Methods included from BooleanMethods

#~

Methods included from OrderMethods

#asc, #desc

Methods included from CastMethods

#cast, #cast_numeric, #cast_string

Methods included from AliasMethods

#as

Methods inherited from Expression

#lit

Constructor Details

#initialize(table, column) ⇒ QualifiedIdentifier

Set the attributes to the given arguments



752
753
754
# File 'lib/sequel_core/sql.rb', line 752

def initialize(table, column)
  @table, @column = table, column
end

Instance Attribute Details

#columnObject (readonly)

The table and column to reference



749
750
751
# File 'lib/sequel_core/sql.rb', line 749

def column
  @column
end

#tableObject (readonly)

The table and column to reference



749
750
751
# File 'lib/sequel_core/sql.rb', line 749

def table
  @table
end

Instance Method Details

#to_s(ds) ⇒ Object

Delegate the creation of the resulting SQL to the given dataset, since it may be database dependent.



758
759
760
# File 'lib/sequel_core/sql.rb', line 758

def to_s(ds)
  ds.qualified_identifier_sql(self)
end