Class PostgresStoreAbstract

PostgreSQL datastore abstraction which can be inherited by a specialised bridge class.

Example

class MyBridgeStore extends PostgresStore {
constructor(myurl) {
super([schemav1, schemav2, schemav3], { url: myurl });
}

async getData() {
return this.sql`SELECT * FROM mytable`
}
}

// Which can then be used by doing
const store = new MyBridgeStore("postgresql://postgres_user:postgres_password@postgres");
store.ensureSchema();
const data = await store.getData();

Constructors

Properties

sql: Sql<{}>

Type declaration

    Accessors

    Methods

    • Ensure the database schema is up to date. If you supplied autocreateSchemaTable to opts in the constructor, a fresh database will have a schema table created for it.

      Returns Promise<void>

      Throws

      If a schema could not be applied cleanly.

    Generated using TypeDoc