diff --git a/lib/prism/orm.rb b/lib/prism/orm.rb new file mode 100644 index 0000000..cd86691 --- /dev/null +++ b/lib/prism/orm.rb @@ -0,0 +1,30 @@ +require_relative 'orm/store' +require_relative 'orm/errors' +require_relative 'orm/relation' +require_relative 'orm/validatable' +require_relative 'orm/associable' +require_relative 'orm/model' +require_relative 'orm/migration' +require_relative 'orm/migrator' + +module Prism + module Orm + class << self + def connect(path) + @store = Store.new(path) + end + + def store + @store || raise('Prism::Orm.connect(path) was not called yet') + end + + def migrator(migrations_path) + Migrator.new(store, migrations_path) + end + + def transaction(&block) + store.transaction(&block) + end + end + end +end