PgClient.ts overview
Since v1.0.0
Exports Grouped by Category
constructor
makeCompiler
Signature
declare const makeCompiler: (transform?: (_: string) => string, transformJson?: boolean) => Statement.Compiler
Since v1.0.0
constructors
PgClientConfig (interface)
Signature
export interface PgClientConfig {
readonly url?: Redacted.Redacted | undefined
readonly host?: string | undefined
readonly port?: number | undefined
readonly path?: string | undefined
readonly ssl?: boolean | ConnectionOptions | undefined
readonly database?: string | undefined
readonly username?: string | undefined
readonly password?: Redacted.Redacted | undefined
readonly idleTimeout?: Duration.DurationInput | undefined
readonly connectTimeout?: Duration.DurationInput | undefined
readonly maxConnections?: number | undefined
readonly minConnections?: number | undefined
readonly connectionTTL?: Duration.DurationInput | undefined
readonly applicationName?: string | undefined
readonly spanAttributes?: Record<string, unknown> | undefined
readonly transformResultNames?: ((str: string) => string) | undefined
readonly transformQueryNames?: ((str: string) => string) | undefined
readonly transformJson?: boolean | undefined
readonly types?: Pg.CustomTypesConfig | undefined
}
Since v1.0.0
make
Signature
declare const make: (options: PgClientConfig) => Effect.Effect<PgClient, SqlError, Scope.Scope | Reactivity.Reactivity>
Since v1.0.0
custom types
PgCustom (type alias)
Signature
type PgCustom = PgJson
Since v1.0.0
layers
layer
Signature
declare const layer: (config: PgClientConfig) => Layer.Layer<PgClient | Client.SqlClient, SqlError>
Since v1.0.0
layerConfig
Signature
declare const layerConfig: (
config: Config.Config.Wrap<PgClientConfig>
) => Layer.Layer<PgClient | Client.SqlClient, ConfigError.ConfigError | SqlError>
Since v1.0.0
models
PgClient (interface)
Signature
export interface PgClient extends Client.SqlClient {
readonly [TypeId]: TypeId
readonly config: PgClientConfig
readonly json: (_: unknown) => Fragment
readonly listen: (channel: string) => Stream.Stream<string, SqlError>
readonly notify: (channel: string, payload: string) => Effect.Effect<void, SqlError>
}
Since v1.0.0
tags
PgClient
Signature
declare const PgClient: Context.Tag<PgClient, PgClient>
Since v1.0.0
type ids
TypeId
Signature
declare const TypeId: "~@effect/sql-pg/PgClient"
Since v1.0.0
TypeId (type alias)
Signature
type TypeId = "~@effect/sql-pg/PgClient"
Since v1.0.0