electronade-pgstore
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

electronade-pgstore

It's a package for electronade that provides store feature using postgresql.
See electronade-pgstore.netlify.app for details.

npm NPM npms.io (quality) Libraries.io dependency status for latest release Maintenance

Installation

npm install electronade-pgstore

What Exposed

electronade: {
  pgstore: {
    get: (
      connectionString: string,
      tableName: string,
      id: string
    ) => Promise<any>;

    getAll: (
      connectionString: string;
      tableName: string;
    ) => Promise<any[]>;

    save: (
      connectionString: string;
      tableName: string;
      item: object
    ) => Promise<any>;

    remove: (
      connectionString: string;
      tableName: string;
      id: string
    ) => Promise<any>;
  }
}

Usage

See electronade usage for details.

const [
  connectionString,
  tableName,
] = [
  "dummy connection string",
  "dummyTable"
];

const item = await electronade.pgstore
  .save(
    connectionString,
    tableName,
    { message: "hello" }
  );

assert.equal(
  await electronade.pgstore
    .get(
      connectionString,
      tableName,
      item._id
    )
    .then(({ message }) => message),
  item.message
);

Readme

Keywords

none

Package Sidebar

Install

npm i electronade-pgstore

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

9.56 kB

Total Files

5

Last publish

Collaborators

  • tomsd