Sha256: f806a65e87d9468312012f11a470b733a03d31a0e21689d1b1cced62e7d13e38

Contents?: true

Size: 807 Bytes

Versions: 2

Compression:

Stored size: 807 Bytes

Contents

<%= config[:camel_cased_app_name] %>::Container.namespace "persistence" do |persistence|
  persistence.finalize(:rom) do
    init do
      require "sequel"
      require "rom"

      use :monitor

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

      rom_config = ROM::Configuration.new(
        :sql,
        persistence.settings.database_url,
        extensions: [:error_sql]
      )

      rom_config.plugin(:sql, relations: :instrumentation) do |p|
        p.notifications = notifications
      end

      persistence.register("config", rom_config)
    end

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

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

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
dry-web-roda-0.6.3 lib/dry/web/roda/skeletons/flat_project/system/boot/rom.rb.tt
dry-web-roda-0.6.3 lib/dry/web/roda/skeletons/umbrella_project/system/boot/rom.rb.tt