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
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() 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
1563 def column_aliases
1564   if @table_expr.is_a?(AliasedExpression)
1565     @table_expr.columns
1566   end
1567 end
table() click to toggle source

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

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