Skip to content

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());