Skip to content

PgClient

Mykhailo Stadnyk edited this page Nov 23, 2020 · 4 revisions

Globals / PgClient

Interface: PgClient

Extends pg.Client with additional properties

Hierarchy

  • Client

    PgClient

Index

Constructors

Properties

Methods

Constructors

constructor

+ new PgClient(config?: string | ClientConfig): PgClient

Inherited from PgClient.constructor

Overrides void

Parameters:

Name Type
config? string | ClientConfig

Returns: PgClient

Properties

appName

appName: string


database

Optional database: undefined | string

Inherited from PgClient.database


host

host: string

Inherited from PgClient.host


password

Optional password: undefined | string

Inherited from PgClient.password


port

port: number

Inherited from PgClient.port


ssl

ssl: boolean

Inherited from PgClient.ssl


user

Optional user: undefined | string

Inherited from PgClient.user

Methods

addListener

addListener(event: string | symbol, listener: (...args: any[]) => void): this

Inherited from PgClient.addListener

Parameters:

Name Type
event string | symbol
listener (...args: any[]) => void

Returns: this


connect

connect(): Promise<void>

Inherited from PgClient.connect

Returns: Promise<void>

connect(callback: (err: Error) => void): void

Inherited from PgClient.connect

Parameters:

Name Type
callback (err: Error) => void

Returns: void


copyFrom

copyFrom(queryText: string): stream.Writable

Inherited from PgClient.copyFrom

Parameters:

Name Type
queryText string

Returns: stream.Writable


copyTo

copyTo(queryText: string): stream.Readable

Inherited from PgClient.copyTo

Parameters:

Name Type
queryText string

Returns: stream.Readable


emit

emit(event: string | symbol, ...args: any[]): boolean

Inherited from PgClient.emit

Parameters:

Name Type
event string | symbol
...args any[]

Returns: boolean


end

end(): Promise<void>

Inherited from PgClient.end

Returns: Promise<void>

end(callback: (err: Error) => void): void

Inherited from PgClient.end

Parameters:

Name Type
callback (err: Error) => void

Returns: void


escapeIdentifier

escapeIdentifier(str: string): string

Inherited from PgClient.escapeIdentifier

Parameters:

Name Type
str string

Returns: string


escapeLiteral

escapeLiteral(str: string): string

Inherited from PgClient.escapeLiteral

Parameters:

Name Type
str string

Returns: string


eventNames

eventNames(): Array<string | symbol>

Inherited from PgClient.eventNames

Returns: Array<string | symbol>


getMaxListeners

getMaxListeners(): number

Inherited from PgClient.getMaxListeners

Returns: number


listenerCount

listenerCount(event: string | symbol): number

Inherited from PgClient.listenerCount

Parameters:

Name Type
event string | symbol

Returns: number


listeners

listeners(event: string | symbol): Function[]

Inherited from PgClient.listeners

Parameters:

Name Type
event string | symbol

Returns: Function[]


off

off(event: string | symbol, listener: (...args: any[]) => void): this

Inherited from PgClient.off

Parameters:

Name Type
event string | symbol
listener (...args: any[]) => void

Returns: this


on

on(event: "drain", listener: () => void): this

Inherited from PgClient.on

Overrides void

Parameters:

Name Type
event "drain"
listener () => void

Returns: this

on(event: "error" | "notice", listener: (err: Error) => void): this

Inherited from PgClient.on

Overrides void

Parameters:

Name Type
event "error" | "notice"
listener (err: Error) => void

Returns: this

on(event: "notification", listener: (message: Notification) => void): this

Inherited from PgClient.on

Overrides void

Parameters:

Name Type
event "notification"
listener (message: Notification) => void

Returns: this

on(event: "end", listener: () => void): this

Inherited from PgClient.on

Overrides void

Parameters:

Name Type
event "end"
listener () => void

Returns: this


once

once(event: string | symbol, listener: (...args: any[]) => void): this

Inherited from PgClient.once

Parameters:

Name Type
event string | symbol
listener (...args: any[]) => void

Returns: this


pauseDrain

pauseDrain(): void

Inherited from PgClient.pauseDrain

Returns: void


prependListener

prependListener(event: string | symbol, listener: (...args: any[]) => void): this

Inherited from PgClient.prependListener

Parameters:

Name Type
event string | symbol
listener (...args: any[]) => void

Returns: this


prependOnceListener

prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this

Inherited from PgClient.prependOnceListener

Parameters:

Name Type
event string | symbol
listener (...args: any[]) => void

Returns: this


query

query<T>(queryStream: T): T

Inherited from PgClient.query

Type parameters:

Name Type
T Submittable

Parameters:

Name Type
queryStream T

Returns: T

query<R, I>(queryConfig: QueryArrayConfig<I>, values?: I): Promise<QueryArrayResult<R>>

Inherited from PgClient.query

Type parameters:

Name Type Default
R any[] any[]
I any[] any[]

Parameters:

Name Type
queryConfig QueryArrayConfig<I>
values? I

Returns: Promise<QueryArrayResult<R>>

query<R, I>(queryConfig: QueryConfig<I>): Promise<QueryResult<R>>

Inherited from PgClient.query

Type parameters:

Name Type Default
R QueryResultRow any
I any[] any[]

Parameters:

Name Type
queryConfig QueryConfig<I>

Returns: Promise<QueryResult<R>>

query<R, I>(queryTextOrConfig: string | QueryConfig<I>, values?: I): Promise<QueryResult<R>>

Inherited from PgClient.query

Type parameters:

Name Type Default
R QueryResultRow any
I any[] any[]

Parameters:

Name Type
queryTextOrConfig string | QueryConfig<I>
values? I

Returns: Promise<QueryResult<R>>

query<R, I>(queryConfig: QueryArrayConfig<I>, callback: (err: Error, result: QueryArrayResult<R>) => void): void

Inherited from PgClient.query

Type parameters:

Name Type Default
R any[] any[]
I any[] any[]

Parameters:

Name Type
queryConfig QueryArrayConfig<I>
callback (err: Error, result: QueryArrayResult<R>) => void

Returns: void

query<R, I>(queryTextOrConfig: string | QueryConfig<I>, callback: (err: Error, result: QueryResult<R>) => void): void

Inherited from PgClient.query

Type parameters:

Name Type Default
R QueryResultRow any
I any[] any[]

Parameters:

Name Type
queryTextOrConfig string | QueryConfig<I>
callback (err: Error, result: QueryResult<R>) => void

Returns: void

query<R, I>(queryText: string, values: any[], callback: (err: Error, result: QueryResult<R>) => void): void

Inherited from PgClient.query

Type parameters:

Name Type Default
R QueryResultRow any
I any[] any[]

Parameters:

Name Type
queryText string
values any[]
callback (err: Error, result: QueryResult<R>) => void

Returns: void


rawListeners

rawListeners(event: string | symbol): Function[]

Inherited from PgClient.rawListeners

Parameters:

Name Type
event string | symbol

Returns: Function[]


removeAllListeners

removeAllListeners(event?: string | symbol): this

Inherited from PgClient.removeAllListeners

Parameters:

Name Type
event? string | symbol

Returns: this


removeListener

removeListener(event: string | symbol, listener: (...args: any[]) => void): this

Inherited from PgClient.removeListener

Parameters:

Name Type
event string | symbol
listener (...args: any[]) => void

Returns: this


resumeDrain

resumeDrain(): void

Inherited from PgClient.resumeDrain

Returns: void


setMaxListeners

setMaxListeners(n: number): this

Inherited from PgClient.setMaxListeners

Parameters:

Name Type
n number

Returns: this