Skip to content

PgClient

Mykhailo Stadnyk edited this page Mar 18, 2020 · 4 revisions

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

Methods

addListener

addListener(event: string | symbol, listener: function): this

Inherited from PgClient.addListener

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


connect

connect(): Promise‹void›

Inherited from PgClient.connect

Returns: Promise‹void›

connect(callback: function): void

Inherited from PgClient.connect

Parameters:

callback: function

▸ (err: Error): void

Parameters:

Name Type
err Error

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: function): void

Inherited from PgClient.end

Parameters:

callback: function

▸ (err: Error): void

Parameters:

Name Type
err Error

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(type: string | symbol): number

Inherited from PgClient.listenerCount

Parameters:

Name Type
type 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: function): this

Inherited from PgClient.off

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


on

on(event: "drain", listener: function): this

Inherited from PgClient.on

Overrides void

Parameters:

event: "drain"

listener: function

▸ (): void

Returns: this

on(event: "error" | "notice", listener: function): this

Inherited from PgClient.on

Overrides void

Parameters:

event: "error" | "notice"

listener: function

▸ (err: Error): void

Parameters:

Name Type
err Error

Returns: this

on(event: "notification", listener: function): this

Inherited from PgClient.on

Overrides void

Parameters:

event: "notification"

listener: function

▸ (message: Notification): void

Parameters:

Name Type
message Notification

Returns: this

on(event: "end", listener: function): this

Inherited from PgClient.on

Overrides void

Parameters:

event: "end"

listener: function

▸ (): void

Returns: this


once

once(event: string | symbol, listener: function): this

Inherited from PgClient.once

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


pauseDrain

pauseDrain(): void

Inherited from PgClient.pauseDrain

Returns: void


prependListener

prependListener(event: string | symbol, listener: function): this

Inherited from PgClient.prependListener

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


prependOnceListener

prependOnceListener(event: string | symbol, listener: function): this

Inherited from PgClient.prependOnceListener

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


query

query<T>(queryStream: T): T

Inherited from PgClient.query

Type parameters:

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:

R: any[]

I: 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:

R: QueryResultRow

I: 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:

R: QueryResultRow

I: any[]

Parameters:

Name Type
queryTextOrConfig string | QueryConfig‹I›
values? I

Returns: Promise‹QueryResult‹R››

query<R, I>(queryConfig: QueryArrayConfig‹I›, callback: function): void

Inherited from PgClient.query

Type parameters:

R: any[]

I: any[]

Parameters:

queryConfig: QueryArrayConfig‹I›

callback: function

▸ (err: Error, result: QueryArrayResult‹R›): void

Parameters:

Name Type
err Error
result QueryArrayResult‹R›

Returns: void

query<R, I>(queryTextOrConfig: string | QueryConfig‹I›, callback: function): void

Inherited from PgClient.query

Type parameters:

R: QueryResultRow

I: any[]

Parameters:

queryTextOrConfig: string | QueryConfig‹I›

callback: function

▸ (err: Error, result: QueryResult‹R›): void

Parameters:

Name Type
err Error
result QueryResult‹R›

Returns: void

query<R, I>(queryText: string, values: any[], callback: function): void

Inherited from PgClient.query

Type parameters:

R: QueryResultRow

I: any[]

Parameters:

queryText: string

values: any[]

callback: function

▸ (err: Error, result: QueryResult‹R›): void

Parameters:

Name Type
err Error
result QueryResult‹R›

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: function): this

Inherited from PgClient.removeListener

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

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

Clone this wiki locally