How to use the bookshelf.instance function in bookshelf

To help you get started, we’ve selected a few bookshelf 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 ncrmro / aeon / server / src / database.ts View on Github external
if (Database.instance) {
      throw new Error(
        "Error: Instantiation failed: Use Database.getInstance() instead of new.",
      );
    }

    this.knex = knex({
      client: "sqlite3",
      connection: {
        filename: "./db.sqlite",
      },
    });

    this.bookshelf = bookshelf(this.knex);

    bookshelf.instance = this;
  }