> [Globals](../globals) / PgClient # Interface: PgClient Extends `pg.Client` with additional properties ## Hierarchy * Client ↳ **PgClient** ## Index ### Constructors * [constructor](PgClient#constructor) ### Properties * [appName](PgClient#appname) * [database](PgClient#database) * [host](PgClient#host) * [password](PgClient#password) * [port](PgClient#port) * [ssl](PgClient#ssl) * [user](PgClient#user) ### Methods * [addListener](PgClient#addlistener) * [connect](PgClient#connect) * [copyFrom](PgClient#copyfrom) * [copyTo](PgClient#copyto) * [emit](PgClient#emit) * [end](PgClient#end) * [escapeIdentifier](PgClient#escapeidentifier) * [escapeLiteral](PgClient#escapeliteral) * [eventNames](PgClient#eventnames) * [getMaxListeners](PgClient#getmaxlisteners) * [listenerCount](PgClient#listenercount) * [listeners](PgClient#listeners) * [off](PgClient#off) * [on](PgClient#on) * [once](PgClient#once) * [pauseDrain](PgClient#pausedrain) * [prependListener](PgClient#prependlistener) * [prependOnceListener](PgClient#prependoncelistener) * [query](PgClient#query) * [rawListeners](PgClient#rawlisteners) * [removeAllListeners](PgClient#removealllisteners) * [removeListener](PgClient#removelistener) * [resumeDrain](PgClient#resumedrain) * [setMaxListeners](PgClient#setmaxlisteners) ## Constructors ### constructor \+ **new PgClient**(`config?`: string \| ClientConfig): [PgClient](PgClient) *Inherited from [PgClient](PgClient).[constructor](PgClient.md#constructor)* *Overrides void* #### Parameters: Name | Type | ------ | ------ | `config?` | string \| ClientConfig | **Returns:** [PgClient](PgClient) ## Properties ### appName • **appName**: string ___ ### database • `Optional` **database**: undefined \| string *Inherited from [PgClient](PgClient).[database](PgClient.md#database)* ___ ### host • **host**: string *Inherited from [PgClient](PgClient).[host](PgClient.md#host)* ___ ### password • `Optional` **password**: undefined \| string *Inherited from [PgClient](PgClient).[password](PgClient.md#password)* ___ ### port • **port**: number *Inherited from [PgClient](PgClient).[port](PgClient.md#port)* ___ ### ssl • **ssl**: boolean *Inherited from [PgClient](PgClient).[ssl](PgClient.md#ssl)* ___ ### user • `Optional` **user**: undefined \| string *Inherited from [PgClient](PgClient).[user](PgClient.md#user)* ## Methods ### addListener ▸ **addListener**(`event`: string \| symbol, `listener`: (...args: any[]) => void): this *Inherited from [PgClient](PgClient).[addListener](PgClient.md#addlistener)* #### Parameters: Name | Type | ------ | ------ | `event` | string \| symbol | `listener` | (...args: any[]) => void | **Returns:** this ___ ### connect ▸ **connect**(): Promise\ *Inherited from [PgClient](PgClient).[connect](PgClient.md#connect)* **Returns:** Promise\ ▸ **connect**(`callback`: (err: Error) => void): void *Inherited from [PgClient](PgClient).[connect](PgClient.md#connect)* #### Parameters: Name | Type | ------ | ------ | `callback` | (err: Error) => void | **Returns:** void ___ ### copyFrom ▸ **copyFrom**(`queryText`: string): stream.Writable *Inherited from [PgClient](PgClient).[copyFrom](PgClient.md#copyfrom)* #### Parameters: Name | Type | ------ | ------ | `queryText` | string | **Returns:** stream.Writable ___ ### copyTo ▸ **copyTo**(`queryText`: string): stream.Readable *Inherited from [PgClient](PgClient).[copyTo](PgClient.md#copyto)* #### Parameters: Name | Type | ------ | ------ | `queryText` | string | **Returns:** stream.Readable ___ ### emit ▸ **emit**(`event`: string \| symbol, ...`args`: any[]): boolean *Inherited from [PgClient](PgClient).[emit](PgClient.md#emit)* #### Parameters: Name | Type | ------ | ------ | `event` | string \| symbol | `...args` | any[] | **Returns:** boolean ___ ### end ▸ **end**(): Promise\ *Inherited from [PgClient](PgClient).[end](PgClient.md#end)* **Returns:** Promise\ ▸ **end**(`callback`: (err: Error) => void): void *Inherited from [PgClient](PgClient).[end](PgClient.md#end)* #### Parameters: Name | Type | ------ | ------ | `callback` | (err: Error) => void | **Returns:** void ___ ### escapeIdentifier ▸ **escapeIdentifier**(`str`: string): string *Inherited from [PgClient](PgClient).[escapeIdentifier](PgClient.md#escapeidentifier)* #### Parameters: Name | Type | ------ | ------ | `str` | string | **Returns:** string ___ ### escapeLiteral ▸ **escapeLiteral**(`str`: string): string *Inherited from [PgClient](PgClient).[escapeLiteral](PgClient.md#escapeliteral)* #### Parameters: Name | Type | ------ | ------ | `str` | string | **Returns:** string ___ ### eventNames ▸ **eventNames**(): Array\ *Inherited from [PgClient](PgClient).[eventNames](PgClient.md#eventnames)* **Returns:** Array\ ___ ### getMaxListeners ▸ **getMaxListeners**(): number *Inherited from [PgClient](PgClient).[getMaxListeners](PgClient.md#getmaxlisteners)* **Returns:** number ___ ### listenerCount ▸ **listenerCount**(`event`: string \| symbol): number *Inherited from [PgClient](PgClient).[listenerCount](PgClient.md#listenercount)* #### Parameters: Name | Type | ------ | ------ | `event` | string \| symbol | **Returns:** number ___ ### listeners ▸ **listeners**(`event`: string \| symbol): Function[] *Inherited from [PgClient](PgClient).[listeners](PgClient.md#listeners)* #### Parameters: Name | Type | ------ | ------ | `event` | string \| symbol | **Returns:** Function[] ___ ### off ▸ **off**(`event`: string \| symbol, `listener`: (...args: any[]) => void): this *Inherited from [PgClient](PgClient).[off](PgClient.md#off)* #### Parameters: Name | Type | ------ | ------ | `event` | string \| symbol | `listener` | (...args: any[]) => void | **Returns:** this ___ ### on ▸ **on**(`event`: \"drain\", `listener`: () => void): this *Inherited from [PgClient](PgClient).[on](PgClient.md#on)* *Overrides void* #### Parameters: Name | Type | ------ | ------ | `event` | \"drain\" | `listener` | () => void | **Returns:** this ▸ **on**(`event`: \"error\" \| \"notice\", `listener`: (err: Error) => void): this *Inherited from [PgClient](PgClient).[on](PgClient.md#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](PgClient).[on](PgClient.md#on)* *Overrides void* #### Parameters: Name | Type | ------ | ------ | `event` | \"notification\" | `listener` | (message: Notification) => void | **Returns:** this ▸ **on**(`event`: \"end\", `listener`: () => void): this *Inherited from [PgClient](PgClient).[on](PgClient.md#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](PgClient).[once](PgClient.md#once)* #### Parameters: Name | Type | ------ | ------ | `event` | string \| symbol | `listener` | (...args: any[]) => void | **Returns:** this ___ ### pauseDrain ▸ **pauseDrain**(): void *Inherited from [PgClient](PgClient).[pauseDrain](PgClient.md#pausedrain)* **Returns:** void ___ ### prependListener ▸ **prependListener**(`event`: string \| symbol, `listener`: (...args: any[]) => void): this *Inherited from [PgClient](PgClient).[prependListener](PgClient.md#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](PgClient).[prependOnceListener](PgClient.md#prependoncelistener)* #### Parameters: Name | Type | ------ | ------ | `event` | string \| symbol | `listener` | (...args: any[]) => void | **Returns:** this ___ ### query ▸ **query**\(`queryStream`: T): T *Inherited from [PgClient](PgClient).[query](PgClient.md#query)* #### Type parameters: Name | Type | ------ | ------ | `T` | Submittable | #### Parameters: Name | Type | ------ | ------ | `queryStream` | T | **Returns:** T ▸ **query**\(`queryConfig`: QueryArrayConfig\, `values?`: I): Promise\> *Inherited from [PgClient](PgClient).[query](PgClient.md#query)* #### Type parameters: Name | Type | Default | ------ | ------ | ------ | `R` | any[] | any[] | `I` | any[] | any[] | #### Parameters: Name | Type | ------ | ------ | `queryConfig` | QueryArrayConfig\ | `values?` | I | **Returns:** Promise\> ▸ **query**\(`queryConfig`: QueryConfig\): Promise\> *Inherited from [PgClient](PgClient).[query](PgClient.md#query)* #### Type parameters: Name | Type | Default | ------ | ------ | ------ | `R` | QueryResultRow | any | `I` | any[] | any[] | #### Parameters: Name | Type | ------ | ------ | `queryConfig` | QueryConfig\ | **Returns:** Promise\> ▸ **query**\(`queryTextOrConfig`: string \| QueryConfig\, `values?`: I): Promise\> *Inherited from [PgClient](PgClient).[query](PgClient.md#query)* #### Type parameters: Name | Type | Default | ------ | ------ | ------ | `R` | QueryResultRow | any | `I` | any[] | any[] | #### Parameters: Name | Type | ------ | ------ | `queryTextOrConfig` | string \| QueryConfig\ | `values?` | I | **Returns:** Promise\> ▸ **query**\(`queryConfig`: QueryArrayConfig\, `callback`: (err: Error, result: QueryArrayResult\) => void): void *Inherited from [PgClient](PgClient).[query](PgClient.md#query)* #### Type parameters: Name | Type | Default | ------ | ------ | ------ | `R` | any[] | any[] | `I` | any[] | any[] | #### Parameters: Name | Type | ------ | ------ | `queryConfig` | QueryArrayConfig\ | `callback` | (err: Error, result: QueryArrayResult\) => void | **Returns:** void ▸ **query**\(`queryTextOrConfig`: string \| QueryConfig\, `callback`: (err: Error, result: QueryResult\) => void): void *Inherited from [PgClient](PgClient).[query](PgClient.md#query)* #### Type parameters: Name | Type | Default | ------ | ------ | ------ | `R` | QueryResultRow | any | `I` | any[] | any[] | #### Parameters: Name | Type | ------ | ------ | `queryTextOrConfig` | string \| QueryConfig\ | `callback` | (err: Error, result: QueryResult\) => void | **Returns:** void ▸ **query**\(`queryText`: string, `values`: any[], `callback`: (err: Error, result: QueryResult\) => void): void *Inherited from [PgClient](PgClient).[query](PgClient.md#query)* #### Type parameters: Name | Type | Default | ------ | ------ | ------ | `R` | QueryResultRow | any | `I` | any[] | any[] | #### Parameters: Name | Type | ------ | ------ | `queryText` | string | `values` | any[] | `callback` | (err: Error, result: QueryResult\) => void | **Returns:** void ___ ### rawListeners ▸ **rawListeners**(`event`: string \| symbol): Function[] *Inherited from [PgClient](PgClient).[rawListeners](PgClient.md#rawlisteners)* #### Parameters: Name | Type | ------ | ------ | `event` | string \| symbol | **Returns:** Function[] ___ ### removeAllListeners ▸ **removeAllListeners**(`event?`: string \| symbol): this *Inherited from [PgClient](PgClient).[removeAllListeners](PgClient.md#removealllisteners)* #### Parameters: Name | Type | ------ | ------ | `event?` | string \| symbol | **Returns:** this ___ ### removeListener ▸ **removeListener**(`event`: string \| symbol, `listener`: (...args: any[]) => void): this *Inherited from [PgClient](PgClient).[removeListener](PgClient.md#removelistener)* #### Parameters: Name | Type | ------ | ------ | `event` | string \| symbol | `listener` | (...args: any[]) => void | **Returns:** this ___ ### resumeDrain ▸ **resumeDrain**(): void *Inherited from [PgClient](PgClient).[resumeDrain](PgClient.md#resumedrain)* **Returns:** void ___ ### setMaxListeners ▸ **setMaxListeners**(`n`: number): this *Inherited from [PgClient](PgClient).[setMaxListeners](PgClient.md#setmaxlisteners)* #### Parameters: Name | Type | ------ | ------ | `n` | number | **Returns:** this