Sha256: e6a5558ba0f827844e002334f8f88f14e27dd0ae47be6a33e4f633fe42bc846e

Contents?: true

Size: 549 Bytes

Versions: 13

Compression:

Stored size: 549 Bytes

Contents

require 'sequel'

Inferno::Application.boot(:db) do
  init do
    use :logging

    require 'yaml'

    Sequel::Model.plugin :json_serializer

    config_path = File.expand_path('database.yml', File.join(Dir.pwd, 'config'))
    config = YAML.load_file(config_path)[ENV['APP_ENV']]
      .merge(logger: Inferno::Application['logger'])
    connection = Sequel.connect(config)
    connection.sql_log_level = :debug

    register('db.config', config)
    register('db.connection', connection)
  end

  start do
    Sequel.extension :migration
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
inferno_core-0.1.3 lib/inferno/config/boot/db.rb
inferno_core-0.1.3.pre2 lib/inferno/config/boot/db.rb
inferno_core-0.1.3.pre lib/inferno/config/boot/db.rb
inferno_core-0.1.2 lib/inferno/config/boot/db.rb
inferno_core-0.1.2.pre lib/inferno/config/boot/db.rb
inferno_core-0.1.1 lib/inferno/config/boot/db.rb
inferno_core-0.1.1.pre lib/inferno/config/boot/db.rb
inferno_core-0.1.0 lib/inferno/config/boot/db.rb
inferno_core-0.1.0.pre lib/inferno/config/boot/db.rb
inferno_core-0.0.8 lib/inferno/config/boot/db.rb
inferno_core-0.0.8.pre2 lib/inferno/config/boot/db.rb
inferno_core-0.0.8.pre lib/inferno/config/boot/db.rb
inferno_core-0.0.7 lib/inferno/config/boot/db.rb