class Sequel::SQL::JoinClause

Represents an SQL JOIN clause, used for joining tables.

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) click to toggle source

Create an object with the given #join_type and table expression.

# File lib/sequel/sql.rb, line 1398
def initialize(join_type, table_expr)
  @join_type = join_type
  @table_expr = table_expr
end

Public Instance Methods

column_aliases() click to toggle source

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

# File lib/sequel/sql.rb, line 1422
def column_aliases
  if @table_expr.is_a?(AliasedExpression)
    @table_expr.columns
  end
end
table() click to toggle source

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

# File lib/sequel/sql.rb, line 1404
def table
  if @table_expr.is_a?(AliasedExpression)
    @table_expr.expression
  else
    @table_expr
  end
end
table_alias() click to toggle source

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

# File lib/sequel/sql.rb, line 1414
def table_alias
  if @table_expr.is_a?(AliasedExpression)
    @table_expr.alias
  end
end