Class: Sequel::SQL::QualifiedColumnRef

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

Overview

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

Constant Summary

Constants included from ColumnMethods

ColumnMethods::AS, ColumnMethods::ASC, ColumnMethods::DESC

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Expression

#lit

Methods included from ColumnMethods

#as, #asc, #cast_as, #desc

Constructor Details

#initialize(table, column) ⇒ QualifiedColumnRef

Set the attributes to the given arguments



455
456
457
# File 'lib/sequel_core/sql.rb', line 455

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

Instance Attribute Details

#columnObject (readonly)

The table and column to reference



452
453
454
# File 'lib/sequel_core/sql.rb', line 452

def column
  @column
end

#tableObject (readonly)

The table and column to reference



452
453
454
# File 'lib/sequel_core/sql.rb', line 452

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.



461
462
463
# File 'lib/sequel_core/sql.rb', line 461

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