Class: DataMapper::Adapters::SqliteAdapter
- Inherits:
-
DataObjectsAdapter
- Object
- DataObjectsAdapter
- DataMapper::Adapters::SqliteAdapter
- Defined in:
- lib/dm-sqlite-adapter/adapter.rb
Instance Method Summary collapse
-
#initialize(name, options) ⇒ SqliteAdapter
constructor
A new instance of SqliteAdapter.
- #normalize_options(options) ⇒ Object
- #supports_subquery?(query, source_key, target_key, qualify) ⇒ Boolean private
Constructor Details
#initialize(name, options) ⇒ SqliteAdapter
Returns a new instance of SqliteAdapter.
9 10 11 |
# File 'lib/dm-sqlite-adapter/adapter.rb', line 9 def initialize(name, ) super(name, ()) end |
Instance Method Details
#normalize_options(options) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/dm-sqlite-adapter/adapter.rb', line 19 def () # TODO Once do_sqlite3 accepts both a Pathname or a String, # normalizing database and path won't be necessary anymore db = ([:database] || .delete('database')).to_s path = ([:path ] || .delete('path')).to_s .update(:adapter => 'sqlite3', :database => db, :path => path) end |
#supports_subquery?(query, source_key, target_key, qualify) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 17 |
# File 'lib/dm-sqlite-adapter/adapter.rb', line 14 def supports_subquery?(query, source_key, target_key, qualify) # SQLite3 cannot match a subquery against more than one column source_key.size == 1 && target_key.size == 1 end |