@react-native-replicache/replicache-generic-sqlite
Version:
> Plug-in React Native compatibility bindings for [Replicache](https://replicache.dev/).
21 lines (20 loc) • 841 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ReplicacheGenericSQLiteWriteImpl = void 0;
var _replicacheGenericSqliteReadImpl = require("./replicache-generic-sqlite-read-impl");
class ReplicacheGenericSQLiteWriteImpl extends _replicacheGenericSqliteReadImpl.ReplicacheGenericSQLiteReadImpl {
async put(key, value) {
const jsonValueString = JSON.stringify(value);
await this._assertTx().execute("INSERT OR REPLACE INTO entry (key, value) VALUES (?, ?)", [key, jsonValueString]);
}
async del(key) {
await this._assertTx().execute("DELETE FROM entry WHERE key = ?", [key]);
}
async commit() {
// Do nothing and wait for release.
}
}
exports.ReplicacheGenericSQLiteWriteImpl = ReplicacheGenericSQLiteWriteImpl;
//# sourceMappingURL=replicache-generic-sqlite-write-impl.js.map