@libreworks/db-provision-pgsql
    Preparing search index...

    Class DatabaseClient

    A connection to a named database on a PostegreSQL server.

    Index
    • Creates a new DatabaseClient.

      Parameters

      • client: Client

        The pg Client instance

      Returns DatabaseClient

    • Configures privileges for admin usage of a schema.

      The connected user must be the schema owner. This method doesn't grant membership in the admin role; use ServerClient.createMemberships for that.

      Parameters

      • schema: Schema

        The schema where the permissions apply

      • adminRole: Role

        The role to which permission should be granted

      Returns Promise<(Grant | DefaultPrivileges)[]>

      A Promise that resolves to the new grants and default privileges

    • Configures privileges for read-only usage of a schema.

      The connected user must be the schema owner. This method doesn't grant membership in the reader role; use ServerClient.createMemberships for that.

      Parameters

      • schema: Schema

        The schema where the permissions apply

      • readerRole: Role

        The role to which permission should be granted

      Returns Promise<(Grant | DefaultPrivileges)[]>

      A Promise that resolves to the new grants and default privileges