The identifier input method to use by default for this database (default: adapter default)
The identifier output method to use by default for this database (default: adapter default)
# File lib/sequel/extensions/identifier_mangling.rb, line 51 def self.extended(db) db.instance_exec do @identifier_input_method = nil @identifier_output_method = nil @quote_identifiers = nil reset_identifier_mangling extend_datasets(DatasetMethods) end end
Set the method to call on identifiers going into the database:
DB[:items] # SELECT * FROM items DB.identifier_input_method = :upcase DB[:items] # SELECT * FROM ITEMS
# File lib/sequel/extensions/identifier_mangling.rb, line 72 def identifier_input_method=(v) reset_default_dataset @identifier_input_method = v end
Set the method to call on identifiers coming from the database:
DB[:items].first # {:id=>1, :name=>'foo'} DB.identifier_output_method = :upcase DB[:items].first # {:ID=>1, :NAME=>'foo'}
# File lib/sequel/extensions/identifier_mangling.rb, line 82 def identifier_output_method=(v) reset_default_dataset @identifier_output_method = v end
Set whether to quote identifiers (columns and tables) for this database:
DB[:items] # SELECT * FROM items DB.quote_identifiers = true DB[:items] # SELECT * FROM "items"
# File lib/sequel/extensions/identifier_mangling.rb, line 92 def quote_identifiers=(v) reset_default_dataset @quote_identifiers = v end
Returns true if the database quotes identifiers.
# File lib/sequel/extensions/identifier_mangling.rb, line 98 def quote_identifiers? @quote_identifiers end