Class: Rails::DataMapper::Storage::Sqlite
- Inherits:
-
Rails::DataMapper::Storage
- Object
- Rails::DataMapper::Storage
- Rails::DataMapper::Storage::Sqlite
- Defined in:
- lib/dm-rails/storage.rb
Instance Attribute Summary
Attributes inherited from Rails::DataMapper::Storage
Instance Method Summary collapse
-
#_create ⇒ Object
This is a noop for sqlite.
- #_drop ⇒ Object
- #create_message ⇒ Object
Methods inherited from Rails::DataMapper::Storage
#charset, #create, create_all, create_environment, #database, #drop, drop_all, drop_environment, #drop_message, #initialize, new, #password, #username
Constructor Details
This class inherits a constructor from Rails::DataMapper::Storage
Instance Method Details
#_create ⇒ Object
This is a noop for sqlite
Overwritten solely for documentation purposes
Both auto_migrate!/auto_upgrade! will create the actual database if the connection has been setup properly and there actually are statements to execute (i.e. at least one model is declared)
DataMapper.setup alone won’t create the actual database so there really is no API to simply create an empty database for sqlite3.
we return true to indicate success nevertheless
133 134 135 |
# File 'lib/dm-rails/storage.rb', line 133 def _create true end |
#_drop ⇒ Object
137 138 139 140 |
# File 'lib/dm-rails/storage.rb', line 137 def _drop return if in_memory? path.unlink if path.file? end |
#create_message ⇒ Object
142 143 144 |
# File 'lib/dm-rails/storage.rb', line 142 def "[datamapper] db:create is a noop for sqlite3, use db:automigrate instead (#{database})" end |