This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { OPSQLiteConnection, open } from '@op-engineering/op-sqlite'; | |
import { | |
AsyncSQLiteAdapter, | |
AsyncSQLiteExecutor, | |
AsyncAdapterSQLiteStorage | |
} from '@triplit/db/storage/adapter-sqlite'; | |
import { AsyncTupleStorageApi } from '@triplit/tuple-database'; | |
// Create DB instance | |
const db = open({ name: 'triplit.db' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { open } from '@op-engineering/op-sqlite'; | |
import { GenericSQLiteStorage, SQLiteAdapter } from './storage/sqlite'; | |
import { OPSQLiteAdapter } from './storage/op-sqlite-adapter'; | |
const cacheDb = open({ name: 'cacheDB' }); | |
const outboxDb = open({ name: 'outboxDB' }); | |
const cacheStorage = new GenericSQLiteStorage(new OPSQLiteAdapter(cacheDb)); | |
// Uncomment line below to "reset" the data in the cache | |
// cacheDb.execute('DELETE FROM data;'); | |
const outboxStorage = new GenericSQLiteStorage(new OPSQLiteAdapter(outboxDb)); |