3510531182
* feat: writeableView options in view collection * refactor: view collection support edit * refactor: view collection support edit * refactor: view collection support edit * refactor: view collection support edit * test: insert into view with join table * chore: typo * chore: package.json * chore: sql parser * chore: query interface * chore: test * feat: update view collection * chore: test * chore: test * chore: github action pg version * fix: params in update and delete * refactor: locale improve --------- Co-authored-by: katherinehhh <katherine_15995@163.com>
21 lines
539 B
TypeScript
21 lines
539 B
TypeScript
import { Collection, CollectionContext, CollectionOptions } from './collection';
|
|
|
|
export class ViewCollection extends Collection {
|
|
constructor(options: CollectionOptions, context: CollectionContext) {
|
|
options.autoGenId = false;
|
|
options.timestamps = false;
|
|
|
|
super(options, context);
|
|
}
|
|
|
|
isView() {
|
|
return true;
|
|
}
|
|
|
|
protected sequelizeModelOptions(): any {
|
|
const modelOptions = super.sequelizeModelOptions();
|
|
modelOptions.tableName = this.options.viewName || this.options.name;
|
|
return modelOptions;
|
|
}
|
|
}
|