Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comment about driver pgnative #542

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Knex's PostgreSQL client allows you to set the initial search path for each conn

```js
const pg = require('knex')({
client: 'pg',
client: 'pg', // or 'pgnative'
connection: process.env.PG_CONNECTION_STRING,
searchPath: ['knex', 'public'],
});
Expand All @@ -63,11 +63,11 @@ const pg = require('knex')({
When using the PostgreSQL driver, another usage pattern for instantiating the Knex configuration object could be to use a `connection: {}` object details to specify various flags such as enabling SSL, a connection string, and individual connection configuration fields all in the same object. Consider the following example:

::: info PostgreSQL
If `connectionString` is highest priority to use. If left unspecified then connection details will be determined using the individual connection fields (`host`, `port`, etc), and finally an SSL configuration will be enabled based on a truthy value of `config["DB_SSL"]` which will also accept self-signed certificates.
`connectionString` is highest priority to use. If left unspecified then connection details will be determined using the individual connection fields (`host`, `port`, etc), and finally an SSL configuration will be enabled based on a truthy value of `config["DB_SSL"]` which will also accept self-signed certificates.

```js
const pg = require('knex')({
client: 'pg',
client: 'pg', // or 'pgnative'
connection: {
connectionString: config.DATABASE_URL,
host: config["DB_HOST"],
Expand Down