Lotes / sqlite-undo-log

An undo log for SQLite 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sqlite-undo-log

Lines of Code Coverage Duplicated Lines (%) Technical Debt

Bugs Code Smells Vulnerabilities

Maintainability Rating Reliability Rating Security Rating

An undo log for SQLite 3

Example

First, wrap the SQLite client...

const database = new NodeSqlite3DatabaseImpl(":memory:");
const connection = await database.connect();

Then, create and install the undo log services...

const api = createUndoLogServices(connection)
const { setup } = api;
const log = await setup.initializeSingle();

Last, but not least: Record your actions and undo them if required.

await log.trackWithin(async () => {
  // <-- record all your INSERT, DELETE & UPDATE statements
});
await log.undo();

Installed table schema

File dependencies

About

An undo log for SQLite 3

License:MIT License


Languages

Language:TypeScript 98.8%Language:JavaScript 1.2%