@@ -45,34 +45,34 @@ You can use either a `postgres://` url connection string or the options to defin
4545
4646``` js
4747const sql = postgres (' postgres://username:password@host:port/database' , {
48- host : ' ' , // Postgres ip address[s] or domain name[s]
49- port : 5432 , // Postgres server port[s]
50- path : ' ' , // unix socket path (usually '/tmp')
51- database : ' ' , // Name of database to connect to
52- username : ' ' , // Username of database user
53- password : ' ' , // Password of database user
54- ssl : false , // true, prefer, require, tls.connect options
55- max : 10 , // Max number of connections
56- idle_timeout : 0 , // Idle connection timeout in seconds
57- connect_timeout : 30 , // Connect timeout in seconds
58- no_prepare : false , // No automatic creation of prepared statements
59- types : [], // Array of custom types, see more below
60- onnotice : fn // Defaults to console.log
61- onparameter : fn // (key, value) when server param change
62- debug : fn // Is called with (connection, query, params)
63- transform : {
64- column : fn, // Transforms incoming column names
65- value : fn, // Transforms incoming row values
66- row : fn // Transforms entire rows
48+ host : ' ' , // Postgres ip address[s] or domain name[s]
49+ port : 5432 , // Postgres server port[s]
50+ path : ' ' , // unix socket path (usually '/tmp')
51+ database : ' ' , // Name of database to connect to
52+ username : ' ' , // Username of database user
53+ password : ' ' , // Password of database user
54+ ssl : false , // true, prefer, require, tls.connect options
55+ max : 10 , // Max number of connections
56+ idle_timeout : 0 , // Idle connection timeout in seconds
57+ connect_timeout : 30 , // Connect timeout in seconds
58+ no_prepare : false , // No automatic creation of prepared statements
59+ types : [], // Array of custom types, see more below
60+ onnotice : fn, // Defaults to console.log
61+ onparameter : fn, // (key, value) when server param change
62+ debug : fn, // Is called with (connection, query, params)
63+ transform : {
64+ column : fn, // Transforms incoming column names
65+ value : fn, // Transforms incoming row values
66+ row : fn // Transforms entire rows
6767 },
68- connection : {
69- application_name : ' postgres.js' , // Default application_name
70- ... // Other connection parameters
68+ connection : {
69+ application_name : ' postgres.js' , // Default application_name
70+ ... // Other connection parameters
7171 },
72- target_session_attrs : null // Use 'read-write' with multiple hosts to
73- // ensure only connecting to primary
74- fetch_array_types : true // Disable automatically fetching array types
75- // on initial connection.
72+ target_session_attrs : null , // Use 'read-write' with multiple hosts to
73+ // ensure only connecting to primary
74+ fetch_array_types : true , // Disable automatically fetching array types
75+ // on initial connection.
7676})
7777```
7878
0 commit comments