Skip to content
From 0.5.0 the packages continue as @cqrs-ddd, documented at aristoteliss.github.io/ddd-cqrs; NestJS applications add @cqrs-ddd/nestjs. This site documents the 0.4.x line.

createCacheTableSql

createCacheTableSql(table?): string

Defined in: packages/ddd-mikro-orm/src/cache/cache-entry.ts:45

SQL that creates the MikroOrmCache table and its expiry index, for PostgreSQL and SQLite. Run it once in a migration. It matches createCacheEntrySchema for the same table.

It returns two statements, separated by ;. The table name is validated as a plain SQL identifier, because it is interpolated, not parameterized.

string = 'cache'

Table name, optionally schema-qualified. Default 'cache'.

string

await orm.em.getConnection().execute(createCacheTableSql());