Class: Sequel::SQL::ColumnAll

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

Overview

Represents all columns in a given table, table.* in SQL

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Expression

#lit

Constructor Details

#initialize(table) ⇒ ColumnAll

Create an object with the given table



531
532
533
# File 'lib/sequel_core/sql.rb', line 531

def initialize(table)
  @table = table
end

Instance Attribute Details

#tableObject (readonly)

The table containing the columns being selected



528
529
530
# File 'lib/sequel_core/sql.rb', line 528

def table
  @table
end

Instance Method Details

#==(x) ⇒ Object

ColumnAll expressions are considered equivalent if they have the same class and string representation



537
538
539
# File 'lib/sequel_core/sql.rb', line 537

def ==(x)
  x.class == self.class && @table == x.table
end

#to_s(ds) ⇒ Object

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



543
544
545
# File 'lib/sequel_core/sql.rb', line 543

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