-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e908665
commit 216b53c
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ PostgreSQL client for Deno | |
|
||
### Client | ||
```ts | ||
import { Client, Pool } from "https://deno.land/x/[email protected].0/mod.ts"; | ||
import { Client, Pool } from "https://deno.land/x/[email protected].1/mod.ts"; | ||
|
||
const client = new Client({ | ||
user: 'postgres', | ||
|
@@ -30,7 +30,7 @@ await client.end(); | |
|
||
### ssl | ||
```js | ||
import { Client, Pool } from "https://deno.land/x/[email protected].0/mod.ts"; | ||
import { Client, Pool } from "https://deno.land/x/[email protected].1/mod.ts"; | ||
|
||
const client = new Client({ | ||
user: 'postgres', | ||
|
@@ -53,7 +53,7 @@ The client pool allows you to have a reusable pool of clients you can check out, | |
|
||
#### Checkout, use, and return | ||
```js | ||
import { Pool } from "https://deno.land/x/[email protected].0/mod.ts"; | ||
import { Pool } from "https://deno.land/x/[email protected].1/mod.ts"; | ||
|
||
const pool = new Pool({ | ||
user: "postgres", | ||
|
@@ -78,7 +78,7 @@ You must always return the client to the pool if you successfully check it out, | |
#### Single query | ||
If you don't need a transaction or you just need to run a single query, the pool has a convenience method to run a query on any available client in the pool. This is the preferred way to query with node-postgres if you can as it removes the risk of leaking a client. | ||
```js | ||
import { Pool } from "https://deno.land/x/[email protected].0/mod.ts"; | ||
import { Pool } from "https://deno.land/x/[email protected].1/mod.ts"; | ||
|
||
const pool = new Pool({ | ||
user: "postgres", | ||
|
@@ -98,7 +98,7 @@ To execute a transaction with node-postgres you simply execute BEGIN / COMMIT / | |
You must use the same client instance for all statements within a transaction. PostgreSQL isolates a transaction to individual clients. This means if you initialize or use transactions with the pool.query method you will have problems. Do not use transactions with the pool.query method. | ||
|
||
```js | ||
import { Pool } from "https://deno.land/x/[email protected].0/mod.ts"; | ||
import { Pool } from "https://deno.land/x/[email protected].1/mod.ts"; | ||
|
||
const pool = new Pool({ | ||
user: "postgres", | ||
|
@@ -128,7 +128,7 @@ try { | |
### Shutdown | ||
To shut down a pool call pool.end() on the pool. This will wait for all checked-out clients to be returned and then shut down all the clients and the pool timers. | ||
```js | ||
import { Pool } from "https://deno.land/x/[email protected].0/mod.ts"; | ||
import { Pool } from "https://deno.land/x/[email protected].1/mod.ts"; | ||
|
||
const pool = new Pool({ | ||
user: "postgres", | ||
|
@@ -184,4 +184,4 @@ interface PoolConfig extends ClientConfig { | |
|
||
```bash | ||
$ deno test --allow-net --allow-read | ||
``` | ||
``` |