Skip to content

Makes use of Keyv to make an even easier SQLite that also cares about dev/prod environments

License

Notifications You must be signed in to change notification settings

npm-made-simple/sqlite-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Makes use of Keyv to make an even easier SQLite that also cares about dev/prod environments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published