# pg

Innoway tích hợp bộ cộng cụ node-postgres giúp người dùng kết nối và thao tác trực tiếp với database Postgres

Chi tiết xem [tại đây](https://node-postgres.com/apis/client)

Ví dụ sử dụng

```javascript
const client = new pg.Client({
  host: '{{host}}',
  port: {{port}},
  database: '{{database}}',
  user: '{{user}}',
  password: {{password}},
})

await client.connect()

let insertDataText = 'INSERT INTO test(name, age) VALUES ($1, $2)'
let insertDataValues = ['Innoway', 2]
const res = await client.query(insertDataText, insertDataValues)

await client.end()

return {}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://innoway.gitbook.io/innoway/tai-lieu/sdk/pg.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
