Sha256: 0711a76500a09a1da9311b7dee78fb8c4d665938823c68e5f1f15e1c24ee6505

Contents?: true

Size: 930 Bytes

Versions: 11

Compression:

Stored size: 930 Bytes

Contents

<%= config[:camel_cased_app_name] %>::Container.boot :persistence, namespace: true do |system|
  init do
    require "sequel"
    require "rom"
    require "rom/sql"

    use :monitor, :settings

    ROM::SQL.load_extensions :postgres

    Sequel.database_timezone = :utc
    Sequel.application_timezone = :local

    rom_config = ROM::Configuration.new(
      :sql,
      system[:settings].database_url,
      extensions: %i[error_sql pg_array pg_json],
    )

    rom_config.plugin :sql, relations: :instrumentation do |plugin_config|
      plugin_config.notifications = notifications
    end

    rom_config.plugin :sql, relations: :auto_restrictions

    register "config", rom_config
    register "db", rom_config.gateways[:default].connection
  end

  start do
    config = container["persistence.config"]
    config.auto_registration system.root.join("lib/persistence")

    register "rom", ROM.container(config)
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
dry-web-roda-0.14.0 lib/dry/web/roda/templates/persistence.rb.tt
dry-web-web_pipe-0.2.0 lib/dry/web/web_pipe/templates/persistence.rb.tt
dry-web-roda-0.13.1 lib/dry/web/roda/templates/persistence.rb.tt
dry-web-roda-0.13.0 lib/dry/web/roda/templates/persistence.rb.tt
dry-web-web_pipe-0.1.0 lib/dry/web/web_pipe/templates/persistence.rb.tt
dry-web-roda-0.12.0 lib/dry/web/roda/templates/persistence.rb.tt
dry-web-roda-0.11.0 lib/dry/web/roda/templates/persistence.rb.tt
dry-web-roda-0.10.0 lib/dry/web/roda/templates/persistence.rb.tt
dry-web-roda-0.9.1 lib/dry/web/roda/templates/persistence.rb.tt
dry-web-roda-0.9.0 lib/dry/web/roda/templates/persistence.rb.tt
dry-web-roda-0.8.0 lib/dry/web/roda/templates/persistence.rb.tt