pg#ClientBase TypeScript Examples
The following examples show how to use
pg#ClientBase.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: db.ts From squid with GNU General Public License v3.0 | 6 votes |
async function withClient(block: (client: ClientBase) => Promise<void>): Promise<void> {
let client = new PgClient(db_config)
await client.connect()
try {
await block(client)
} finally {
await client.end()
}
}
Example #2
Source File: setup.ts From squid with GNU General Public License v3.0 | 6 votes |
async function withClient(block: (client: ClientBase) => Promise<void>): Promise<void> {
let client = new PgClient(db_config)
await client.connect()
try {
await block(client)
} finally {
await client.end()
}
}
Example #3
Source File: db.ts From squid with GNU General Public License v3.0 | 5 votes |
constructor(private client: ClientBase) {}