Methods

Class Index [+]

Quicksearch

Sequel::Qualifier

Handles qualifying existing datasets, so that unqualified columns in the dataset are qualified with a given table name.

Public Class Methods

new(ds, table) click to toggle source

Store the dataset to use as the basis for qualification, and the table used to qualify unqualified columns.

    # File lib/sequel/ast_transformer.rb, line 82
82:     def initialize(ds, table)
83:       @ds = ds
84:       @table = table
85:     end

Private Instance Methods

v(o) click to toggle source

Turn SQL::Identifiers and symbols that aren’t implicitly qualified into SQL::QualifiedIdentifiers. For symbols that are not implicitly qualified by are implicitly aliased, return an SQL::AliasedExpressions with a qualified version of the symbol.

     # File lib/sequel/ast_transformer.rb, line 93
 93:     def v(o)
 94:       case o
 95:       when Symbol
 96:         t, column, aliaz = @ds.send(:split_symbol, o)
 97:         if t
 98:           o
 99:         elsif aliaz
100:           SQL::AliasedExpression.new(SQL::QualifiedIdentifier.new(@table, SQL::Identifier.new(column)), aliaz)
101:         else
102:           SQL::QualifiedIdentifier.new(@table, o)
103:         end
104:       when SQL::Identifier
105:         SQL::QualifiedIdentifier.new(@table, o)
106:       when SQL::QualifiedIdentifier, SQL::JoinClause
107:         # Return these directly, so we don't accidentally qualify symbols in them.
108:         o
109:       else
110:         super
111:       end
112:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.