Sha256: 6ad9a55bd52f67d46d66561bcb93f82e79aaff53f2f133a2da719ee3e85716ab
Contents?: true
Size: 1.09 KB
Versions: 3
Compression:
Stored size: 1.09 KB
Contents
require 'rom/support/cache' module ROM module SQL # Used as a pair table name + field name. # Similar to Sequel::SQL::QualifiedIdentifier but we don't want # Sequel types to leak into ROM # # @api private class QualifiedAttribute include Dry::Equalizer(:dataset, :attribute) extend Cache # Dataset (table) name # # @api private attr_reader :dataset # Attribute (field, column) name # # @api private attr_reader :attribute # @api private def self.[](*args) fetch_or_store(args) { new(*args) } end # @api private def initialize(dataset, attribute) @dataset = dataset @attribute = attribute end # Used by Sequel for building SQL statements # # @api private def sql_literal_append(ds, sql) ds.qualified_identifier_sql_append(sql, dataset, attribute) end # Convinient interface for attribute names # # @return [Symbol] # # @api private def to_sym attribute end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rom-sql-0.9.1 | lib/rom/sql/qualified_attribute.rb |
rom-sql-0.9.0 | lib/rom/sql/qualified_attribute.rb |
rom-sql-0.8.0 | lib/rom/sql/qualified_attribute.rb |