Sha256: 17edc27eed34190f4384c14da61011acb0fbaaf13887aa5ecd5df374675443ed

Contents?: true

Size: 687 Bytes

Versions: 3

Compression:

Stored size: 687 Bytes

Contents

# encoding: utf-8

require 'bundler'
Bundler.require(:sequel)

# environment setup
ENV['DATABASE_LOG_LEVEL'] ||= 'info'
ENV['DATABASE_MAX_CONNECTIONS'] ||= 4
ENV['DATABASE_SSLMODE'] ||= 'prefer'
ENV['DATABASE_TIMEOUT'] ||= 10

# database instance options
sequel_opts = { 
  loggers: [Logger.new($stdout, ENV['DATABASE_LOG_LEVEL'])],
  max_connections: ENV['DATABASE_MAX_CONNECTIONS'].to_i,
  sslmode: ENV['DATABASE_SSLMODE'],
  connect_timeout: ENV['DATABASE_TIMEOUT']
}

# database connection
DB = Sequel.connect(ENV['DATABASE_URL'], sequel_opts)

# load postgres specific datatype support
DB.extension :pg_array
DB.extension :pg_hstore
DB.extension :pg_json
DB.extension :pg_streaming

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
daiku-0.2.2 lib/daiku/plugins/sequel/_templates/sequel.rb.tt
daiku-0.2.1 lib/daiku/plugins/sequel/_templates/sequel.rb.tt
daiku-0.2.0 lib/daiku/plugins/sequel/_templates/sequel.rb.tt