Releases: tinyplex/tinybase
v6.7.1
v6.7.0
This release includes support for the Origin Private File System (OPFS) in a browser. The createOpfsPersister function is the main entry point, and is available in the existing persister-browser module:
import {createStore} from 'tinybase';
import {createOpfsPersister} from 'tinybase/persisters/persister-browser';
const opfs = await navigator.storage.getDirectory();
const handle = await opfs.getFileHandle('tinybase.json', {create: true});
const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
const persister = createOpfsPersister(store, handle);
await persister.save();
// Store JSON will be saved to the OPFS file.
await persister.load();
// Store JSON will be loaded from the OPFS file.
await persister.destroy();
That's it! If you've used other TinyBase persisters, this API should be easy and familiar to use.
One caveat: observability in OPFS is not yet standardized in browsers. This means that the auto-load functionality of the persister may not work as expected, although a best effort is made using the experimental FileSystemObserverAPI, so please let us know how that works!
v6.6.1
This release updates dependencies.
v6.6.0
This release improves the Inspector tool, making it easier to debug, inspect, and mutate your TinyBase stores.

As well as a modernized UI, new in this release is the ability to create, duplicate, or delete tables, rows, values and cells directly within the Inspector. Press the 'pencil' icon to start editing items, and then hover over the new icons to see how to manipulate the data.
See the Inspecting Data guide for more information about how to use the Inspector in your application during development.
v6.5.2
This release updates dependencies.
v6.5.1
This release updates dependencies.
v6.5.0
This release includes the new persister-react-native-mmkv module, which allows you to persist data in a React Native MMKV store via the react-native-mmkv library.
Usage should be as simple as this:
import {MMKV} from 'react-native-mmkv';
import {createStore} from 'tinybase';
import {createReactNativeMmkvPersister} from 'tinybase/persisters/persister-react-native-mmkv';
const storage = new MMKV();
const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
const persister = createReactNativeMmkvPersister(store, storage);
await persister.save();
// Store will be saved to the MMKV store.
A huge shout out to Jérémy Barbet for this new persister!
v6.4.2
v6.4.1
This release updates dependencies.
v6.4.0
This release includes the new persister-react-native-sqlite module, which allows you to persist data in a React Native SQLite database via the react-native-sqlite-storage library.
Usage should be as simple as this:
import {enablePromise, openDatabase} from 'react-native-sqlite-storage';
import {createStore} from 'tinybase';
import {createReactNativeSqlitePersister} from 'tinybase/persisters/persister-react-native-sqlite';
enablePromise(true);
const db = await openDatabase({name: 'my.db', location: 'default'});
const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
const persister = createReactNativeSqlitePersister(store, db);
await persister.save();
// Store will be saved to the database.
Please let us know how you get on with this new Persister, and if you have any feedback or suggestions.