Datacenter build and management service
Conch::DB:::Util - utility functions for working with the Conch database
Return the credentials and connection options suitable for passing to Conch::DB for both read-write and read-only connections, containing keys:
returns a hashref containing keys:
dsn
username
password
options
ro_username
ro_password
Overrides are accepted from the following environment variables:
POSTGRES_DB
POSTGRES_HOST
POSTGRES_USER
POSTGRES_PASSWORD
If not all credentials can be determined from environment variables, the $config
is read
from. It should be a database configuration hashref (such as that extracted from conch.conf
at the appropriate hash key), or a subref that returns the hashref.
Retrieves the current running version of postgres.
Returns as a tuple the number of the latest database migration that has been applied, and the latest migration file found on disk.
Note that the migration level retrieved from the database does *not* have leading zeroes.
Initialize an empty database with the conch user and role and create empty tables.
Bring the Conch database up to the latest migration.
Sets up the static validation plans currently in use by Conch.
Copyright Joyent, Inc.
This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.