Releases: tinyplex/tinybase
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.
v6.3.1
This release updates dependencies.
v6.3.0
This release includes the new persister-durable-object-sql-storage module, which allows you to persist data in a Cloudflare Durable Object's SQLite-based storage in conjunction with websocket-based synchronization (using the WsServerDurableObject class).
Huge thanks to Corey Jepperson, @acoreyj, for implementing the entirety of this functionality!
import {createMergeableStore} from 'tinybase';
import {createDurableObjectSqlStoragePersister} from 'tinybase/persisters/persister-durable-object-sql-storage';
import {WsServerDurableObject} from 'tinybase/synchronizers/synchronizer-ws-server-durable-object';
const config = {
mode: 'fragmented',
storagePrefix: 'my_app_',
};
export class MyDurableObject extends WsServerDurableObject {
createPersister() {
const store = createMergeableStore();
const persister = createDurableObjectSqlStoragePersister(
store,
this.ctx.storage.sql,
config,
);
return persister;
}
}Prior to this release, the only way to persist data in a Durable Object was to use the persister-durable-object-storage module, which uses CloudFlare's key-value storage backend behind the scenes.
However, Cloudflare's SQLite storage backend for Durable Objects offers significantly better pricing compared to the key-value storage backend. The SQLite storage backend is Cloudflare's recommended storage option for new Durable Object namespaces.
Note that, before using this persister, you must configure your Durable Object class to use SQLite storage by adding a migration to your wrangler.toml or wrangler.json configuration file. Use new_sqlite_classes in your migration configuration to enable SQLite storage for your Durable Object class. See the module documentation for more information.
This release also addresses a local-storage persistence issue, #257.