Skip to content

Commit

Permalink
Add comment about driver pgnative
Browse files Browse the repository at this point in the history
Added a comment to the guide referencing the pgnative driver, similar
to the comment mentioning better-sqlite3. Fixes #539

Removed an unneccessary "if" from the PostgreSQL info block
  • Loading branch information
wolfhoundjesse committed Sep 28, 2023
1 parent a9c4ce4 commit c1981a3
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit c1981a3

Please sign in to comment.