Class Sequel::SQL::JoinClause
In: lib/sequel/sql.rb
Parent: Expression

Represents an SQL JOIN clause, used for joining tables.

Methods

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

Create an object with the given join_type and table expression.

[Source]

      # File lib/sequel/sql.rb, line 1480
1480:       def initialize(join_type, table_expr)
1481:         @join_type = join_type
1482:         @table_expr = table_expr
1483:       end

Public Instance methods

The column aliases to use for the JOIN , or nil if the JOIN does not use a derived column list.

[Source]

      # File lib/sequel/sql.rb, line 1504
1504:       def column_aliases
1505:         if @table_expr.is_a?(AliasedExpression)
1506:           @table_expr.columns
1507:         end
1508:       end

The table/set related to the JOIN, without any alias.

[Source]

      # File lib/sequel/sql.rb, line 1486
1486:       def table
1487:         if @table_expr.is_a?(AliasedExpression)
1488:           @table_expr.expression
1489:         else
1490:           @table_expr
1491:         end
1492:       end

The table alias to use for the JOIN , or nil if the JOIN does not alias the table.

[Source]

      # File lib/sequel/sql.rb, line 1496
1496:       def table_alias
1497:         if @table_expr.is_a?(AliasedExpression)
1498:           @table_expr.alias
1499:         end
1500:       end

[Validate]