Added PG object details

Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
This commit is contained in:
Andre Wanlin
2023-05-24 11:52:40 -05:00
parent 0eea1e0304
commit 4ef91ab467
2 changed files with 63 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-common': patch
---
Updated the backend database connection configuration schema to include the full PG object details in order to set the password visibility to secret
+58 -2
View File
@@ -14,6 +14,9 @@
* limitations under the License.
*/
import { CustomTypesConfig } from 'pg';
import { ConnectionOptions } from 'tls';
export interface Config {
app: {
baseUrl: string; // defined in core, but repeated here without doc
@@ -72,10 +75,63 @@ export interface Config {
/** Default database client to use */
client: 'better-sqlite3' | 'sqlite3' | 'pg';
/**
* Base database connection string or Knex object
* Base database connection string or Knex (PG) object
* PG object details come from: https://node-postgres.com/apis/client
* @visibility secret
*/
connection: string | object;
connection:
| string
| {
/**
* User with which to authenticate to the server
*/
user?: string;
/**
* Corresponding password
* @visibility secret
*/
password: string;
/**
* Postgres server hostname or, for UNIX domain sockets, the socket filename
*/
host?: string;
/**
* Database name within the server
*/
database?: string;
/**
* Port on which to connect
*/
port?: number;
/**
* TLS/SSL connections settings
*/
ssl?: boolean | ConnectionOptions;
/**
* Custom type parsers
*/
types?: CustomTypesConfig;
/**
* Number of milliseconds before a statement in query will time out, default is no timeout
*/
statement_timeout?: false | number;
/**
* Number of milliseconds before a query call will timeout, default is no timeout
*/
query_timeout?: number;
/**
* The name of the application that created this Client instance
*/
application_name?: string;
/**
* Number of milliseconds to wait for connection, default is no timeout
*/
connectionTimeoutMillis?: number;
/**
* Number of milliseconds before terminating any session with an open idle transaction, default is no timeout
*/
idle_in_transaction_session_timeout?: number;
};
/** Database name prefix override */
prefix?: string;
/**