A connection to the "postgres" database on a PostegreSQL server.

Constructors

  • Creates a new ServerClient.

    Parameters

    • client: Client

      The pg Client instance

    Returns ServerClient

Methods

  • Create a new database catalog only if it does not already exist.

    Parameters

    • catalog: Catalog

      The database catalog to create

    Returns Promise<void>

    A Promise that resolves when the operation completes

  • Execute a grant statement.

    Parameters

    • grant: Grant

      The grant to perform

    Returns Promise<void>

    A Promise that resolves when the operation completes

  • Create a new login only if it does not already exist.

    Parameters

    • role: Role

      The login to create

    Returns Promise<void>

    A Promise that resolves when the operation completes

  • Tests to see if the database already exists.

    Parameters

    • name: string

      The database name

    Returns Promise<boolean>

    A Promise that resolves to true if the database exists

  • Tests to see if the user already exists.

    Parameters

    • username: string

      The username to test

    Returns Promise<boolean>

    A Promise that resolves to true if the user exists