/** * @param {import("postgres").Options|undefined} opts * @returns {import("postgres").Options} */ export function buildAndCheckOpts(opts: postgres.Options | undefined): postgres.Options; /** * Create a new postgres connection, using the default environment variables. * A database may be created using the provided credentials. * * Note that by default we add a 'dateOrTimeOnly' type, which serializes and parses * 'date' and 'time' columns, used by `T.date().timeOnly()` and `T.date().dateOnly()', as * strings. * * With `createIfNotExists`, Compas will try to connect to Postgres and first check if * the database exists before establishing the requested connection. Postgres will * default to connect to a database with the same name as the provided user, but you can * manually specify the 'maintenanceDatabase' for the temporary connection. * * @since 0.1.0 * * @param {import("postgres").Options & { * createIfNotExists?: boolean, * maintenanceDatabaase?: string, * }} [opts] * @returns {Promise>} */ export function newPostgresConnection(opts?: postgres.Options & { createIfNotExists?: boolean; maintenanceDatabaase?: string; }): Promise>; /** * @param sql * @param databaseName * @param maintenanceDatabase * @param template * @param connectionOptions * @returns {Promise>} */ export function createDatabaseIfNotExists(sql: any, databaseName: any, maintenanceDatabase: any, template: any, connectionOptions: any): Promise>; export { postgres }; import postgres from "postgres";