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



662
663
664
# File 'lib/sequel_core/sql.rb', line 662

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

Instance Attribute Details

#columnObject (readonly)

The table and column to reference



659
660
661
# File 'lib/sequel_core/sql.rb', line 659

def column
  @column
end

#tableObject (readonly)

The table and column to reference



659
660
661
# File 'lib/sequel_core/sql.rb', line 659

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.



668
669
670
# File 'lib/sequel_core/sql.rb', line 668

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