Skip to content

Commit a158f03

Browse files
authored
docs: code style consistency
1 parent 57e93b5 commit a158f03

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

docs/pages/index.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The simplest possible way to connect, query, and disconnect is with async/await:
4444

4545
```js
4646
import { Client } from 'pg'
47-
const client = await new Client().connect();
47+
const client = await new Client().connect()
4848

4949
const res = await client.query('SELECT $1::text as message', ['Hello world!'])
5050
console.log(res.rows[0].message) // Hello world!
@@ -55,10 +55,9 @@ await client.end()
5555

5656
For the sake of simplicity, these docs will assume that the methods are successful. In real life use, make sure to properly handle errors thrown in the methods. A `try/catch` block is a great way to do so:
5757

58-
```ts
58+
```js
5959
import { Client } from 'pg'
60-
const client = new Client()
61-
await client.connect()
60+
const client = await new Client().connect()
6261

6362
try {
6463
const res = await client.query('SELECT $1::text as message', ['Hello world!'])

0 commit comments

Comments
 (0)