-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathconfig.js
41 lines (35 loc) · 1.09 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* SPDX-FileCopyrightText: 2016-present Kriasoft <[email protected]> */
/* SPDX-License-Identifier: MIT */
const fs = require("fs");
/**
* Configuration settings for Knex database client.
*
* NOTE: Using vanilla JavaScript here for better performance
* when used with automation scripts (yarn db:migrate etc.).
*
* @type {import("knex").Knex.Config}
*/
module.exports = {
client: "pg",
connection: {
ssl: process.env.PGSSLMODE === "verify-ca" && {
cert: fs.readFileSync(process.env.PGSSLCERT, "ascii"),
key: fs.readFileSync(process.env.PGSSLKEY, "ascii"),
ca: fs.readFileSync(process.env.PGSSLROOTCERT, "ascii"),
servername: process.env.PGSERVERNAME,
},
},
// Cloud Functions limits concurrent executions to 1 per instance. You never
// have a situation where a single function instance is processing two
// requests at the same time. In most situations, only a single database
// connection is needed.
pool: {
min: 0,
max: 1,
},
migrations: {
schemaName: "public",
tableName: "migration",
},
debug: process.env.PGDEBUG,
};