Skip to content

Commit

Permalink
v0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingZhang authored Oct 14, 2021
1 parent e908665 commit 216b53c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -184,4 +184,4 @@ interface PoolConfig extends ClientConfig {

```bash
$ deno test --allow-net --allow-read
```
```

0 comments on commit 216b53c

Please sign in to comment.