Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async init() {
if (this.url) {
await this.connect();
} else {
if (!this.connectionString) {
throw new Error("No PG connection string given");
}
if (!this.slotName) {
throw new Error("this.slotName is blank");
}
this.lds = await subscribeToLogicalDecoding(
this.connectionString,
this.handleAnnouncement,
{
slotName: this.slotName,
temporary: true,
sleepDuration: this.sleepDuration,
tablePattern: this.tablePattern,
}
);
}
}