Class: EventDb::MemoryDatabase

Inherits:
Database
  • Object
show all
Defined in:
lib/eventdb/database.rb

Overview

convenience class for in-memory (SQLite3) database

Instance Method Summary collapse

Methods inherited from Database

#add, #connect, #create, #create_all, #read

Constructor Details

#initializeMemoryDatabase

Returns a new instance of MemoryDatabase.



58
59
60
61
62
63
64
65
66
67
# File 'lib/eventdb/database.rb', line 58

def initialize
  ## -- default to sqlite3 in-memory database
  super( adapter:  'sqlite3',
         database: ':memory:' )

  ## step 1) (auto-)connect
  connect
  ## step 2) (auto-)migrate, that is, create tables, etc.
  create_all    # -- incl. props, logs tables etc.
end