Represents an SQL JOIN clause, used for joining tables.
The type of join to do
The expression representing the table/set related to the JOIN. Is an AliasedExpression if the JOIN uses an alias.
Create an object with the given #join_type and table expression.
# File lib/sequel/sql.rb, line 1397 def initialize(join_type, table, table_alias = nil) @join_type = join_type @table_expr = if table.is_a?(AliasedExpression) table # REMOVE411 elsif table_alias Deprecation.deprecate("The table_alias argument to Sequel::SQL::JoinClause#initialize", "Please use a Sequel::SQL::AliasedExpression as the table argument instead.") AliasedExpression.new(table, table_alias) else table end end
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, line 1430 def column_aliases if @table_expr.is_a?(AliasedExpression) @table_expr.columns end end
The table/set related to the JOIN, without any alias.
# File lib/sequel/sql.rb, line 1412 def table if @table_expr.is_a?(AliasedExpression) @table_expr.expression else @table_expr end end
The table alias to use for the JOIN , or nil if the JOIN does not alias the table.
# File lib/sequel/sql.rb, line 1422 def table_alias if @table_expr.is_a?(AliasedExpression) @table_expr.alias end end