Module: Sequel::IdentifierMangling::DatabaseMethods
- Defined in:
- lib/sequel/extensions/identifier_mangling.rb
Instance Attribute Summary collapse
-
#identifier_input_method ⇒ Object
The identifier input method to use by default for this database (default: adapter default).
-
#identifier_output_method ⇒ Object
The identifier output method to use by default for this database (default: adapter default).
Class Method Summary collapse
Instance Method Summary collapse
-
#quote_identifiers=(v) ⇒ Object
Set whether to quote identifiers (columns and tables) for this database:.
-
#quote_identifiers? ⇒ Boolean
Returns true if the database quotes identifiers.
Instance Attribute Details
#identifier_input_method ⇒ Object
The identifier input method to use by default for this database (default: adapter default)
55 56 57 |
# File 'lib/sequel/extensions/identifier_mangling.rb', line 55 def identifier_input_method @identifier_input_method end |
#identifier_output_method ⇒ Object
The identifier output method to use by default for this database (default: adapter default)
58 59 60 |
# File 'lib/sequel/extensions/identifier_mangling.rb', line 58 def identifier_output_method @identifier_output_method end |
Class Method Details
.extended(db) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/sequel/extensions/identifier_mangling.rb', line 44 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 |
Instance Method Details
#quote_identifiers=(v) ⇒ Object
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"
85 86 87 88 |
# File 'lib/sequel/extensions/identifier_mangling.rb', line 85 def quote_identifiers=(v) reset_default_dataset @quote_identifiers = v end |
#quote_identifiers? ⇒ Boolean
Returns true if the database quotes identifiers.
91 92 93 |
# File 'lib/sequel/extensions/identifier_mangling.rb', line 91 def quote_identifiers? @quote_identifiers end |