Class: Sequel::SQL::JoinClause
- Inherits:
-
Expression
- Object
- Expression
- Sequel::SQL::JoinClause
- Defined in:
- lib/sequel/sql.rb
Overview
Represents an SQL JOIN clause, used for joining tables.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#join_type ⇒ Object
readonly
The type of join to do.
-
#table ⇒ Object
readonly
The actual table to join.
-
#table_alias ⇒ Object
readonly
The table alias to use for the join, if any.
Instance Method Summary collapse
-
#initialize(join_type, table, table_alias = nil) ⇒ JoinClause
constructor
Create an object with the given conditions and default value.
-
#to_s(ds) ⇒ Object
Delegate the creation of the resulting SQL to the given dataset, since it may be database dependent.
Methods inherited from Expression
Constructor Details
#initialize(join_type, table, table_alias = nil) ⇒ JoinClause
Create an object with the given conditions and default value.
604 605 606 |
# File 'lib/sequel/sql.rb', line 604 def initialize(join_type, table, table_alias = nil) @join_type, @table, @table_alias = join_type, table, table_alias end |
Instance Attribute Details
#join_type ⇒ Object (readonly)
The type of join to do
594 595 596 |
# File 'lib/sequel/sql.rb', line 594 def join_type @join_type end |
#table ⇒ Object (readonly)
The actual table to join
597 598 599 |
# File 'lib/sequel/sql.rb', line 597 def table @table end |
#table_alias ⇒ Object (readonly)
The table alias to use for the join, if any
600 601 602 |
# File 'lib/sequel/sql.rb', line 600 def table_alias @table_alias 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.
610 611 612 |
# File 'lib/sequel/sql.rb', line 610 def to_s(ds) ds.join_clause_sql(self) end |