Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add common parameter names to ConnectionParameters TS type #707

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ const sql = postgres('postgres://username:password@host:port/database', {
},
connection : {
application_name : 'postgres.js', // Default application_name
... // Other connection parameters
... // Other connection parameters, see https://www.postgresql.org/docs/current/runtime-config-client.html
},
target_session_attrs : null, // Use 'read-write' with multiple hosts to
// ensure only connecting to primary
Expand Down
2 changes: 1 addition & 1 deletion deno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ const sql = postgres('postgres://username:password@host:port/database', {
},
connection : {
application_name : 'postgres.js', // Default application_name
... // Other connection parameters
... // Other connection parameters, see https://www.postgresql.org/docs/current/runtime-config-client.html
},
target_session_attrs : null, // Use 'read-write' with multiple hosts to
// ensure only connecting to primary
Expand Down
12 changes: 11 additions & 1 deletion deno/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,18 @@ declare namespace postgres {
* @default 'postgres.js'
*/
application_name: string;
default_transaction_isolation: 'read uncommitted' | 'read committed' | 'repeatable read' | 'serializable',
default_transaction_read_only: boolean,
default_transaction_deferrable: boolean,
statement_timeout: number,
lock_timeout: number,
idle_in_transaction_session_timeout: number,
idle_session_timeout: number,
DateStyle: string,
IntervalStyle: string,
TimeZone: string,
/** Other connection parameters */
[name: string]: string;
[name: string]: string | number | boolean;
}

interface Options<T extends Record<string, postgres.PostgresType>> extends Partial<BaseOptions<T>> {
Expand Down
12 changes: 11 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,18 @@ declare namespace postgres {
* @default 'postgres.js'
*/
application_name: string;
default_transaction_isolation: 'read uncommitted' | 'read committed' | 'repeatable read' | 'serializable',
default_transaction_read_only: boolean,
default_transaction_deferrable: boolean,
statement_timeout: number,
lock_timeout: number,
idle_in_transaction_session_timeout: number,
idle_session_timeout: number,
DateStyle: string,
IntervalStyle: string,
TimeZone: string,
/** Other connection parameters */
[name: string]: string;
[name: string]: string | number | boolean;
}

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