You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// > sslmode – This option determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server. There are six modes:
// todo: let this depend on the configured matching parallelism
29
+
max: parseInt(process.env.PG_POOL_SIZE||'30'),
30
+
}
31
+
if(ssl||opt.ssl){
32
+
pgOpts.ssl={
33
+
...(ssl||{}),
34
+
...(opt.ssl||{}),
35
+
}
36
+
}
37
+
returnpgOpts
38
+
}
39
+
4
40
constconnectToPostgres=(opt={})=>{
5
41
// todo?
6
42
// > Do not use pool.query if you need transactional integrity: the pool will dispatch every query passed to pool.query on the first available idle client. Transactions within PostgreSQL are scoped to a single client and so dispatching individual queries within a single transaction across multiple, random clients will cause big problems in your app and not work. For more info please read transactions.
7
43
// https://node-postgres.com/api/pool
8
-
constdb=newPool({
9
-
...opt,
10
-
// todo: let this depend on the configured matching parallelism
11
-
max: parseInt(process.env.PG_POOL_SIZE||'30'),
12
-
})
44
+
constdb=newPool(getPgOpts(opt))
13
45
14
46
// todo: don't parse timestamptz into JS Date, keep ISO 8601 strings
15
47
// todo: don't parse date into JS Date, keep ISO 8601 strings
0 commit comments