Module | Sequel::Dataset::DatasetSourceAlias |
In: |
lib/sequel/extensions/dataset_source_alias.rb
|
Preprocess the list of sources and attempt to alias any datasets in the sources to the first source of the resepctive dataset.
# File lib/sequel/extensions/dataset_source_alias.rb, line 46 46: def from(*source, &block) 47: virtual_row_columns(source, block) 48: table_aliases = [] 49: source = source.map do |s| 50: case s 51: when Dataset 52: s = dataset_source_alias_expression(s, table_aliases) 53: when Symbol, String, SQL::AliasedExpression, SQL::Identifier, SQL::QualifiedIdentifier 54: table_aliases << alias_symbol(s) 55: end 56: s 57: end 58: super(*source, &nil) 59: end
If a Dataset is given as the table argument, attempt to alias it to its source.
# File lib/sequel/extensions/dataset_source_alias.rb, line 63 63: def join_table(type, table, expr=nil, options=OPTS) 64: if table.is_a?(Dataset) && !options[:table_alias] 65: table = dataset_source_alias_expression(table) 66: end 67: super 68: end