How to use @graphile/lds - 1 common examples

To help you get started, we’ve selected a few @graphile/lds examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphile / graphile-engine / packages / subscriptions-lds / src / PgLDSSourcePlugin.ts View on Github external
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,
        }
      );
    }
  }

@graphile/lds

Logical decoding server for PostgreSQL, monitors for new/edited/deleted rows and announces them to interested clients.

MIT
Latest version published 2 years ago

Package Health Score

64 / 100
Full package analysis

Popular @graphile/lds functions