Class: Sequel::SQL::ColumnAll

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

Overview

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

Constant Summary

Constants included from ColumnMethods

Sequel::SQL::ColumnMethods::AS, Sequel::SQL::ColumnMethods::ASC, Sequel::SQL::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) ⇒ ColumnAll

Create an object with the given table



54
55
56
# File 'lib/sequel_core/sql.rb', line 54

def initialize(table)
  @table = table
end

Instance Attribute Details

#tableObject (readonly)

The table containing the columns being selected



51
52
53
# File 'lib/sequel_core/sql.rb', line 51

def table
  @table
end

Instance Method Details

#==(x) ⇒ Object

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



60
61
62
# File 'lib/sequel_core/sql.rb', line 60

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.



66
67
68
# File 'lib/sequel_core/sql.rb', line 66

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