Skip to content

Commit

Permalink
feat: applicationName parameter for CockroachDB (#8800)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanko0511 committed Mar 26, 2022
1 parent 54c7db4 commit 79b7f5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/driver/cockroachdb/CockroachConnectionOptions.ts
Expand Up @@ -44,6 +44,12 @@ export interface CockroachConnectionOptions
readonly slaves: CockroachConnectionCredentialsOptions[]
}

/**
* sets the application_name var to help db administrators identify
* the service using this connection. Defaults to 'undefined'
*/
readonly applicationName?: string

/*
* Function handling errors thrown by drivers pool.
* Defaults to logging error with `warn` level.
Expand Down
1 change: 1 addition & 0 deletions src/driver/cockroachdb/CockroachDriver.ts
Expand Up @@ -923,6 +923,7 @@ export class CockroachDriver implements Driver {
database: credentials.database,
port: credentials.port,
ssl: credentials.ssl,
application_name: options.applicationName,
},
options.extra || {},
)
Expand Down

0 comments on commit 79b7f5c

Please sign in to comment.