Skip to main content Link Search Menu Expand Document (external link)

PgLayer overview

Main module

Added in v1.0.0


Table of contents


config

makeConfig

Signature

export declare const makeConfig: (options?: Partial<ConfigOptions>) => _Config.Config<Config>

Added in v1.0.0

setConfig

Signature

export declare const setConfig: (
  options?: Partial<ConfigOptions>
) => Layer.Layer<pg.PoolConfig | pg.ClientConfig, ConfigError.ConfigError>

Added in v1.0.0

layer

Client

Signature

export declare const Client: Layer.Layer<pg.ClientBase, PgError.PostgresConnectionError, pg.ClientConfig>

Added in v1.0.0

Pool

Signature

export declare const Pool: Layer.Layer<pg.Pool, never, pg.PoolConfig>

Added in v1.0.0

PoolClient

Signature

export declare const PoolClient: Layer.Layer<pg.ClientBase | pg.PoolClient, PgError.PostgresConnectionError, pg.Pool>

Added in v1.0.0

models

Config (interface)

Signature

export interface Config {
  host: string
  port: number
  user: string
  password: string
  database: string
}

Added in v1.0.0

ConfigOptions (interface)

Signature

export interface ConfigOptions {
  namePrefix: string
  defaultHost?: string
  defaultPort?: number
  defaultUser?: string
  defaultPassword?: string
  defaultDatabase?: string
}

Added in v1.0.0