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

feat: add databaseMirroringPartner event handler #1671

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,10 @@ class Connection extends EventEmitter {
* @private
*/
emit(event: 'databaseChange', databaseName: string): boolean
/**
* @private
*/
emit(event: 'databaseMirroringPartner', partnerInstanceName: string): boolean
/**
* @private
*/
Expand Down
8 changes: 4 additions & 4 deletions src/token/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@
this.connection.emit('databaseChange', token.newValue);
}

onDatabaseMirroringPartner(token: DatabaseMirroringPartnerEnvChangeToken) {
this.connection.emit('databaseMirroringPartner', token.newValue);

Check warning on line 288 in src/token/handler.ts

View check run for this annotation

Codecov / codecov/patch

src/token/handler.ts#L288

Added line #L288 was not covered by tests
}

onLanguageChange(token: LanguageEnvChangeToken) {
this.connection.emit('languageChange', token.newValue);
}
Expand Down Expand Up @@ -355,10 +359,6 @@
onPacketSizeChange(token: PacketSizeEnvChangeToken) {
this.connection.messageIo.packetSize(token.newValue);
}

onDatabaseMirroringPartner(token: DatabaseMirroringPartnerEnvChangeToken) {
// Do nothing
}
}
Comment on lines 361 to 362
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this handler to be right below the onDatabaseChange event handler for better ordering and to keep the event next to all of the other ENVCHANGE events.


/**
Expand Down
Loading