From c1981a3a5048473ef82dfc37db06ebe885ea81ad Mon Sep 17 00:00:00 2001 From: "Jesse M. Holmes" Date: Thu, 28 Sep 2023 08:11:59 -0400 Subject: [PATCH] Add comment about driver pgnative 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 --- src/guide/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/guide/index.md b/src/guide/index.md index 222674d0..f97ec442 100644 --- a/src/guide/index.md +++ b/src/guide/index.md @@ -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'], }); @@ -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"],