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
1474 def initialize(join_type, table_expr)
1475   @join_type = join_type
1476   @table_expr = table_expr
1477   freeze
1478 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
1499 def column_aliases
1500   if @table_expr.is_a?(AliasedExpression)
1501     @table_expr.columns
1502   end
1503 end
table() click to toggle source

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

     # File lib/sequel/sql.rb
1481 def table
1482   if @table_expr.is_a?(AliasedExpression)
1483     @table_expr.expression
1484   else
1485     @table_expr
1486   end
1487 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
1491 def table_alias
1492   if @table_expr.is_a?(AliasedExpression)
1493     @table_expr.alias
1494   end
1495 end