-
Notifications
You must be signed in to change notification settings - Fork 9
PgClient
Globals / PgClient
Extends pg.Client
with additional properties
-
Client
↳ PgClient
- addListener
- connect
- copyFrom
- copyTo
- emit
- end
- escapeIdentifier
- escapeLiteral
- eventNames
- getMaxListeners
- listenerCount
- listeners
- off
- on
- once
- pauseDrain
- prependListener
- prependOnceListener
- query
- rawListeners
- removeAllListeners
- removeListener
- resumeDrain
- setMaxListeners
+ new PgClient(config?
: string | ClientConfig): PgClient
Inherited from PgClient.constructor
Overrides void
Name | Type |
---|---|
config? |
string | ClientConfig |
Returns: PgClient
• appName: string
• Optional
database: undefined | string
Inherited from PgClient.database
• host: string
• Optional
password: undefined | string
Inherited from PgClient.password
• port: number
• ssl: boolean
• Optional
user: undefined | string
▸ addListener(event
: string | symbol, listener
: (...args: any[]) => void): this
Inherited from PgClient.addListener
Name | Type |
---|---|
event |
string | symbol |
listener |
(...args: any[]) => void |
Returns: this
▸ connect(): Promise<void>
Inherited from PgClient.connect
Returns: Promise<void>
▸ connect(callback
: (err: Error) => void): void
Inherited from PgClient.connect
Name | Type |
---|---|
callback |
(err: Error) => void |
Returns: void
▸ copyFrom(queryText
: string): stream.Writable
Inherited from PgClient.copyFrom
Name | Type |
---|---|
queryText |
string |
Returns: stream.Writable
▸ copyTo(queryText
: string): stream.Readable
Inherited from PgClient.copyTo
Name | Type |
---|---|
queryText |
string |
Returns: stream.Readable
▸ emit(event
: string | symbol, ...args
: any[]): boolean
Name | Type |
---|---|
event |
string | symbol |
...args |
any[] |
Returns: boolean
▸ end(): Promise<void>
Returns: Promise<void>
▸ end(callback
: (err: Error) => void): void
Name | Type |
---|---|
callback |
(err: Error) => void |
Returns: void
▸ escapeIdentifier(str
: string): string
Inherited from PgClient.escapeIdentifier
Name | Type |
---|---|
str |
string |
Returns: string
▸ escapeLiteral(str
: string): string
Inherited from PgClient.escapeLiteral
Name | Type |
---|---|
str |
string |
Returns: string
▸ eventNames(): Array<string | symbol>
Inherited from PgClient.eventNames
Returns: Array<string | symbol>
▸ getMaxListeners(): number
Inherited from PgClient.getMaxListeners
Returns: number
▸ listenerCount(event
: string | symbol): number
Inherited from PgClient.listenerCount
Name | Type |
---|---|
event |
string | symbol |
Returns: number
▸ listeners(event
: string | symbol): Function[]
Inherited from PgClient.listeners
Name | Type |
---|---|
event |
string | symbol |
Returns: Function[]
▸ off(event
: string | symbol, listener
: (...args: any[]) => void): this
Name | Type |
---|---|
event |
string | symbol |
listener |
(...args: any[]) => void |
Returns: this
▸ on(event
: "drain", listener
: () => void): this
Overrides void
Name | Type |
---|---|
event |
"drain" |
listener |
() => void |
Returns: this
▸ on(event
: "error" | "notice", listener
: (err: Error) => void): this
Overrides void
Name | Type |
---|---|
event |
"error" | "notice" |
listener |
(err: Error) => void |
Returns: this
▸ on(event
: "notification", listener
: (message: Notification) => void): this
Overrides void
Name | Type |
---|---|
event |
"notification" |
listener |
(message: Notification) => void |
Returns: this
▸ on(event
: "end", listener
: () => void): this
Overrides void
Name | Type |
---|---|
event |
"end" |
listener |
() => void |
Returns: this
▸ once(event
: string | symbol, listener
: (...args: any[]) => void): this
Name | Type |
---|---|
event |
string | symbol |
listener |
(...args: any[]) => void |
Returns: this
▸ pauseDrain(): void
Inherited from PgClient.pauseDrain
Returns: void
▸ prependListener(event
: string | symbol, listener
: (...args: any[]) => void): this
Inherited from PgClient.prependListener
Name | Type |
---|---|
event |
string | symbol |
listener |
(...args: any[]) => void |
Returns: this
▸ prependOnceListener(event
: string | symbol, listener
: (...args: any[]) => void): this
Inherited from PgClient.prependOnceListener
Name | Type |
---|---|
event |
string | symbol |
listener |
(...args: any[]) => void |
Returns: this
▸ query<T>(queryStream
: T): T
Name | Type |
---|---|
T |
Submittable |
Name | Type |
---|---|
queryStream |
T |
Returns: T
▸ query<R, I>(queryConfig
: QueryArrayConfig<I>, values?
: I): Promise<QueryArrayResult<R>>
Name | Type | Default |
---|---|---|
R |
any[] | any[] |
I |
any[] | any[] |
Name | Type |
---|---|
queryConfig |
QueryArrayConfig<I> |
values? |
I |
Returns: Promise<QueryArrayResult<R>>
▸ query<R, I>(queryConfig
: QueryConfig<I>): Promise<QueryResult<R>>
Name | Type | Default |
---|---|---|
R |
QueryResultRow | any |
I |
any[] | any[] |
Name | Type |
---|---|
queryConfig |
QueryConfig<I> |
Returns: Promise<QueryResult<R>>
▸ query<R, I>(queryTextOrConfig
: string | QueryConfig<I>, values?
: I): Promise<QueryResult<R>>
Name | Type | Default |
---|---|---|
R |
QueryResultRow | any |
I |
any[] | any[] |
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
Name | Type | Default |
---|---|---|
R |
any[] | any[] |
I |
any[] | any[] |
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
Name | Type | Default |
---|---|---|
R |
QueryResultRow | any |
I |
any[] | any[] |
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
Name | Type | Default |
---|---|---|
R |
QueryResultRow | any |
I |
any[] | any[] |
Name | Type |
---|---|
queryText |
string |
values |
any[] |
callback |
(err: Error, result: QueryResult<R>) => void |
Returns: void
▸ rawListeners(event
: string | symbol): Function[]
Inherited from PgClient.rawListeners
Name | Type |
---|---|
event |
string | symbol |
Returns: Function[]
▸ removeAllListeners(event?
: string | symbol): this
Inherited from PgClient.removeAllListeners
Name | Type |
---|---|
event? |
string | symbol |
Returns: this
▸ removeListener(event
: string | symbol, listener
: (...args: any[]) => void): this
Inherited from PgClient.removeListener
Name | Type |
---|---|
event |
string | symbol |
listener |
(...args: any[]) => void |
Returns: this
▸ resumeDrain(): void
Inherited from PgClient.resumeDrain
Returns: void
▸ setMaxListeners(n
: number): this
Inherited from PgClient.setMaxListeners
Name | Type |
---|---|
n |
number |
Returns: this