Files
lib/src/orm/support/CacheModel.ts

22 lines
578 B
TypeScript
Raw Normal View History

2021-06-02 22:36:25 -05:00
import {Model} from '../model/Model'
import {Field} from '../model/Field'
import {FieldType} from '../types'
2021-06-01 20:59:40 -05:00
/**
* A model instance which stores records from the ORMCache driver.
*/
export class CacheModel extends Model<CacheModel> {
protected static table = 'caches'; // FIXME allow configuring
2021-06-02 22:36:25 -05:00
2021-06-01 20:59:40 -05:00
protected static key = 'cache_key';
@Field(FieldType.varchar, 'cache_key')
public cacheKey!: string;
@Field(FieldType.text, 'cache_value')
public cacheValue!: string;
@Field(FieldType.timestamp, 'cache_expires')
public cacheExpires?: Date;
}