@curium.rocks/sql-chronicler
TypeScript icon, indicating that this package has built-in type declarations

0.73.0 • Public • Published

SQL-Chronicler

Quality Gate Status Coverage Security Rating

This library archives data events, status events, and general records from data emitters to a sql database. Supported database types include MariaDB, MySQL, Postgres, Sqlite, and SQL Server. It's intended to be included in a project as a library, see https://github.com/curium-rocks/maestro for an example of emitter and chronicler usage.

How to install

npm install --save @curium.rocks/sql-chronicler

How to create a chronicler

// create a factory and register it with the provider
const factory = new SqlChroniclerFactory();
ProviderSingleton.getInstance().registerChroniclerFactory(SqlChronicler.TYPE, factory);

const description: IChroniclerDescription = {
    id: 'test-id',
    name: 'test-name',
    description: 'test-description',
    type: SqlChronicler.TYPE,
    chroniclerProperties: {
        type: 'sqlite'
    }
}
const chronicler = await ProviderSingleton.getInstance().buildChronicler(description);

How to connect an emitter to a chronicler

yourEmitter.onData(yourChronicler.saveRecord.bind(yourChronicler));

Package Sidebar

Install

npm i @curium.rocks/sql-chronicler

Weekly Downloads

93

Version

0.73.0

License

MIT

Unpacked Size

69 kB

Total Files

41

Last publish

Collaborators

  • curium-deployer
  • akboyd88