requires 'perl', '5.020';

# The transactional_ddl declaration in DBIO::PostgreSQL::Storage relies on
# core's DBIO::Deploy::Base::_execute_ddl, which brackets only a handle the
# storage owns and groups a batch by _ddl_statement_is_transactional.
requires 'DBIO', '0.900007';
# 3.19.0 for the DSN: from 3.17.0 a ';' inside a quoted value stays in the
# value, from 3.19.0 a quote inside a quoted value passes unescaped
# (the model of DBIO::PostgreSQL::Util and the broker DSN, t/83, t/108);
# pg_error_field from 3.9.0 (the error fields of Storage::_dbi_error_fields);
# the placeholder escape '\?' from 3.7.1.
requires 'DBD::Pg', '3.19.0';
requires 'DateTime::Format::Pg';
# The random part of the temporary database's name (DBIO::PostgreSQL::Deploy)
requires 'Crypt::URandom', '0';

# future_io async transport (DBIO::PostgreSQL::Storage::Async): the shared
# Future::IO backend base lives in dbio-async, resolved at runtime BY
# CONVENTION (ref($storage).'::Async', ADR 0030) only when a connection asks
# for { async => 'future_io' }. A recommends, not a requires: the sync-only
# driver (DBIO::PostgreSQL::Storage) never loads it, so a sync-only install
# stays free of the Future::IO stack.
#
# The adapter relies on dbio-async's _collect_result($conn) seam signature
# (ADR 0044) and on its _txn_context_class / _txn_conn_accessor defaults.
recommends 'DBIO::Async', '0.900007';

# The same dbio-async carries what the async transport relies on: the
# Future::IO listen seams (_listen_drain, _notify_sql) for LISTEN/NOTIFY,
# _conn_error_is_fatal to retire a connection a failed statement left dead,
# _idle_connection_alive for an idle connection whose backend died, and the
# per-connection statement queue of _query_async_pinned for two statements on
# one transaction context. Core carries the listen contract and the
# _txn_commit_rolled_back seam.

on test => sub {
  # A Future::IO event-loop implementation for the live future_io roundtrip
  # (t/37-future-io-live.t); IO::Async is the recommended one.
  recommends 'Future::IO::Impl::IOAsync';
  recommends 'IO::Async';
  requires 'Test::More', '0.98';
  requires 'Test::Exception';
  requires 'Test::Warn';
  requires 'Test::Fatal';
  requires 'Sub::Name';
};
