@made-simple/sqlite-store
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

Simple Logging @made-simple/sqlite-store


Using Keyv to store data even easier with SQLite with care for development environments. Extending the functionality of Keyv to copy data from one store to another and wipe development data.

Also with optional typings for what is store in the database, reconciliation, fallbacks, error reverting, and more. Keyv naturally uses async/await but this package does not.

Installation

npm install @made-simple/sqlite-store

Example Usage

const Store = require('@made-simple/sqlite-store');

const template = {
    foo: "bar",
    bar: 6
}

const store = new Store<typeof template>("path/to/database");
store.reconcile(template);

store.set("foo", "bar");
store.get("bar", 6); // will be 6 if not found, this will be set in the database too
store.copyFrom(store2, true) // 2nd argument is if it should start from a clean store
store.copyKey(store2, "foo", "bar") // attempts to copy the key foo from store2 to store, if not found, it will set it to bar

License

MIT

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Repository

Contributors

@alexasterisk

Package Sidebar

Install

npm i @made-simple/sqlite-store

Weekly Downloads

2

Version

1.3.2

License

MIT

Unpacked Size

23.5 kB

Total Files

5

Last publish

Collaborators

  • alexasterisk