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
1524 def initialize(join_type, table_expr)
1525   @join_type = join_type
1526   @table_expr = table_expr
1527   freeze
1528 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
1549 def column_aliases
1550   if @table_expr.is_a?(AliasedExpression)
1551     @table_expr.columns
1552   end
1553 end
table() click to toggle source

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

     # File lib/sequel/sql.rb
1531 def table
1532   if @table_expr.is_a?(AliasedExpression)
1533     @table_expr.expression
1534   else
1535     @table_expr
1536   end
1537 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
1541 def table_alias
1542   if @table_expr.is_a?(AliasedExpression)
1543     @table_expr.alias
1544   end
1545 end