class Sequel::SQL::JoinClause
Represents an SQL
JOIN clause, used for joining tables.
Attributes
join_type[R]
The type of join to do
table_expr[R]
The expression representing the table/set related to the JOIN. Is an AliasedExpression
if the JOIN uses an alias.
Public Class Methods
new(join_type, table_expr)
click to toggle source
Create an object with the given join_type
and table expression.
# File lib/sequel/sql.rb 1536 def initialize(join_type, table_expr) 1537 @join_type = join_type 1538 @table_expr = table_expr 1539 freeze 1540 end
Public Instance Methods
column_aliases()
click to toggle source
The column aliases to use for the JOIN , or nil if the JOIN does not use a derived column list.
# File lib/sequel/sql.rb 1561 def column_aliases 1562 if @table_expr.is_a?(AliasedExpression) 1563 @table_expr.columns 1564 end 1565 end
table()
click to toggle source
The table/set related to the JOIN, without any alias.
# File lib/sequel/sql.rb 1543 def table 1544 if @table_expr.is_a?(AliasedExpression) 1545 @table_expr.expression 1546 else 1547 @table_expr 1548 end 1549 end
table_alias()
click to toggle source
The table alias to use for the JOIN , or nil if the JOIN does not alias the table.
# File lib/sequel/sql.rb 1553 def table_alias 1554 if @table_expr.is_a?(AliasedExpression) 1555 @table_expr.alias 1556 end 1557 end