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 1476
1476:       def initialize(join_type, table_expr)
1477:         @join_type = join_type
1478:         @table_expr = table_expr
1479:         freeze
1480:       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 1501
1501:       def column_aliases
1502:         if @table_expr.is_a?(AliasedExpression)
1503:           @table_expr.columns
1504:         end
1505:       end

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

[Source]

      # File lib/sequel/sql.rb, line 1483
1483:       def table
1484:         if @table_expr.is_a?(AliasedExpression)
1485:           @table_expr.expression
1486:         else
1487:           @table_expr
1488:         end
1489:       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 1493
1493:       def table_alias
1494:         if @table_expr.is_a?(AliasedExpression)
1495:           @table_expr.alias
1496:         end
1497:       end

[Validate]