class Sequel::SQL::JoinClause

  1. lib/sequel/sql.rb
Superclass: Expression

Represents an SQL JOIN clause, used for joining tables.

Methods

Public Class

  1. new

Public Instance

  1. column_aliases
  2. join_type
  3. table
  4. table_alias
  5. table_expr

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)

Create an object with the given join_type and table expression.

[show source]
     # File lib/sequel/sql.rb
1548 def initialize(join_type, table_expr)
1549   @join_type = join_type
1550   @table_expr = table_expr
1551   freeze
1552 end

Public Instance methods

column_aliases()

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

[show source]
     # File lib/sequel/sql.rb
1573 def column_aliases
1574   if @table_expr.is_a?(AliasedExpression)
1575     @table_expr.columns
1576   end
1577 end
table()

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

[show source]
     # File lib/sequel/sql.rb
1555 def table
1556   if @table_expr.is_a?(AliasedExpression)
1557     @table_expr.expression
1558   else
1559     @table_expr
1560   end
1561 end
table_alias()

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

[show source]
     # File lib/sequel/sql.rb
1565 def table_alias
1566   if @table_expr.is_a?(AliasedExpression)
1567     @table_expr.alias
1568   end
1569 end