Databases Bundles and Bodies

Table of Contents

See the databases promises documentation for a comprehensive reference on the body types and attributes used here.

To use these bodies, add the following to your policy:

body file control
{
    inputs => { "databases.cf" }
}

database_server bodies

local_mysql

Prototype: local_mysql(username, password)

Description: Defines a MySQL server running on localhost

Arguments:

  • username: The username for the server connection
  • password: The password for the server connection

See also: db_server_owner, db_server_password

Implementation:

body database_server local_mysql(username, password)
{
      db_server_owner => "$(username)";
      db_server_password => "$(password)";
      db_server_host => "localhost";
      db_server_type => "mysql";
      db_server_connection_db => "mysql";
}

local_postgresql

Prototype: local_postgresql(username, password)

Description: Defines a PostgreSQL server running on localhost

Arguments:

  • username: The username for the server connection
  • password: The password for the server connection

See also: db_server_owner, db_server_password

Implementation:

body database_server local_postgresql(username, password)
{
      db_server_owner => "$(username)";
      db_server_password => "$(password)";
      db_server_host => "localhost";
      db_server_type => "postgres";
      db_server_connection_db => "postgres";
}