class Sequel::SQL::JoinClause

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

Represents an SQL JOIN clause, used for joining tables.


Public Class

  1. new

Public Instance

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


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
1539 def initialize(join_type, table_expr)
1540   @join_type = join_type
1541   @table_expr = table_expr
1542   freeze
1543 end

Public Instance methods


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
1564 def column_aliases
1565   if @table_expr.is_a?(AliasedExpression)
1566     @table_expr.columns
1567   end
1568 end

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

[show source]
     # File lib/sequel/sql.rb
1546 def table
1547   if @table_expr.is_a?(AliasedExpression)
1548     @table_expr.expression
1549   else
1550     @table_expr
1551   end
1552 end

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
1556 def table_alias
1557   if @table_expr.is_a?(AliasedExpression)
1558     @table_expr.alias
1559   end
1560 end