Skip to content

Commit ca2754c

Browse files
authored
Add common parameter names to ConnectionParameters TS type (porsager#707)
1 parent f2fb819 commit ca2754c

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ const sql = postgres('postgres://username:password@host:port/database', {
983983
},
984984
connection : {
985985
application_name : 'postgres.js', // Default application_name
986-
... // Other connection parameters
986+
... // Other connection parameters, see https://www.postgresql.org/docs/current/runtime-config-client.html
987987
},
988988
target_session_attrs : null, // Use 'read-write' with multiple hosts to
989989
// ensure only connecting to primary

deno/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ const sql = postgres('postgres://username:password@host:port/database', {
971971
},
972972
connection : {
973973
application_name : 'postgres.js', // Default application_name
974-
... // Other connection parameters
974+
... // Other connection parameters, see https://www.postgresql.org/docs/current/runtime-config-client.html
975975
},
976976
target_session_attrs : null, // Use 'read-write' with multiple hosts to
977977
// ensure only connecting to primary

deno/types/index.d.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,18 @@ declare namespace postgres {
331331
* @default 'postgres.js'
332332
*/
333333
application_name: string;
334+
default_transaction_isolation: 'read uncommitted' | 'read committed' | 'repeatable read' | 'serializable',
335+
default_transaction_read_only: boolean,
336+
default_transaction_deferrable: boolean,
337+
statement_timeout: number,
338+
lock_timeout: number,
339+
idle_in_transaction_session_timeout: number,
340+
idle_session_timeout: number,
341+
DateStyle: string,
342+
IntervalStyle: string,
343+
TimeZone: string,
334344
/** Other connection parameters */
335-
[name: string]: string;
345+
[name: string]: string | number | boolean;
336346
}
337347

338348
interface Options<T extends Record<string, postgres.PostgresType>> extends Partial<BaseOptions<T>> {

types/index.d.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,18 @@ declare namespace postgres {
329329
* @default 'postgres.js'
330330
*/
331331
application_name: string;
332+
default_transaction_isolation: 'read uncommitted' | 'read committed' | 'repeatable read' | 'serializable',
333+
default_transaction_read_only: boolean,
334+
default_transaction_deferrable: boolean,
335+
statement_timeout: number,
336+
lock_timeout: number,
337+
idle_in_transaction_session_timeout: number,
338+
idle_session_timeout: number,
339+
DateStyle: string,
340+
IntervalStyle: string,
341+
TimeZone: string,
332342
/** Other connection parameters */
333-
[name: string]: string;
343+
[name: string]: string | number | boolean;
334344
}
335345

336346
interface Options<T extends Record<string, postgres.PostgresType>> extends Partial<BaseOptions<T>> {

0 commit comments

Comments
 (0)