Bier.CLI.DbSettings (bier v0.1.0)

Copy Markdown View Source

The in-database config source (PostgREST Config/Database.hs queryDbSettings): reads pgrst.* settings from pg_catalog.pg_db_role_setting for the connecting role — cluster-wide and current-database-specific, the latter winning — filtered to the Bier.CLI.Config.db_settings_names/0 whitelist, and returns them as a %{kebab_key => raw_string} map for Bier.CLI.Config.load/4's db source.

Summary

Functions

Connect with the resolved db-uri (plus PG* fallbacks, see Bier.CLI.Config.connection_opts/2), read the role settings, and return them keyed by kebab config key. Connection or query failures come back as {:error, message} for the CLI's fatal-error path.

Functions

fetch(resolved, env)

@spec fetch(map(), map()) :: {:ok, map()} | {:error, String.t()}

Connect with the resolved db-uri (plus PG* fallbacks, see Bier.CLI.Config.connection_opts/2), read the role settings, and return them keyed by kebab config key. Connection or query failures come back as {:error, message} for the CLI's fatal-error path.