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 1400
1400:       def initialize(join_type, table_expr)
1401:         @join_type = join_type
1402:         @table_expr = table_expr
1403:       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 1424
1424:       def column_aliases
1425:         if @table_expr.is_a?(AliasedExpression)
1426:           @table_expr.columns
1427:         end
1428:       end

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

[Source]

      # File lib/sequel/sql.rb, line 1406
1406:       def table
1407:         if @table_expr.is_a?(AliasedExpression)
1408:           @table_expr.expression
1409:         else
1410:           @table_expr
1411:         end
1412:       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 1416
1416:       def table_alias
1417:         if @table_expr.is_a?(AliasedExpression)
1418:           @table_expr.alias
1419:         end
1420:       end

[Validate]