@moirae/typeorm
TypeScript icon, indicating that this package has built-in type declarations

0.6.0 • Public • Published

@moirae/typeorm

A Moirae plugin leveraging a SQL database providing:

  • EventStore: entity model for the database table

  • TypeORMStore: overriding the default EVENT_STORE token

  • KeyValue: entity model for a key-value cache

  • SetRoot/SetValue: entity models for a set cache

  • TypeORMCache: overriding the default CACHE token

Compatibility

The following have been tested with Moirae and are known to be compatible.

  • [x] sqlite3
  • [x] postgresql

Usage

When using this module, it's required to explicitly import TypeOrmModule.forFeature(<EntityArr>) into the Moirae config. The <EntityArr> should contain:

  • The EventStore entity if using TypeORM as an event store
  • The CACHE_ENTITIES array if using TypeORM as a cache

The TypeORM plugin may be used as an event store, a cache, or both.

MoiraeModule.forRootAsync({
    cache: {
        type: "typeorm",
    },
    imports: [TypeOrmModule.forFeature([EventStore, CACHE_ENTITIES])],
    store: {
        type: "typeorm",
    }
})

Readme

Keywords

none

Package Sidebar

Install

npm i @moirae/typeorm

Weekly Downloads

0

Version

0.6.0

License

MIT

Unpacked Size

338 kB

Total Files

43

Last publish

Collaborators

  • chance-admin