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
1538 def initialize(join_type, table_expr)
1539   @join_type = join_type
1540   @table_expr = table_expr
1541   freeze
1542 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
1563 def column_aliases
1564   if @table_expr.is_a?(AliasedExpression)
1565     @table_expr.columns
1566   end
1567 end
table ()

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

[show source]
     # File lib/sequel/sql.rb
1545 def table
1546   if @table_expr.is_a?(AliasedExpression)
1547     @table_expr.expression
1548   else
1549     @table_expr
1550   end
1551 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
1555 def table_alias
1556   if @table_expr.is_a?(AliasedExpression)
1557     @table_expr.alias
1558   end
1559 end