UNPKG

1.65 kBTypeScriptView Raw
1import { Connection, SelectQueryBuilder } from "..";
2import { OrderByCondition } from "../find-options/OrderByCondition";
3import { TableType } from "../metadata/types/TableTypes";
4/**
5 * Arguments for TableMetadata class, helps to construct an TableMetadata object.
6 */
7export interface TableMetadataArgs {
8 /**
9 * Class to which table is applied.
10 * Function target is a table defined in the class.
11 * String target is a table defined in a json schema.
12 */
13 target: Function | string;
14 /**
15 * Table's name. If name is not set then table's name will be generated from target's name.
16 */
17 name?: string;
18 /**
19 * Table type. Tables can be abstract, closure, junction, embedded, etc.
20 */
21 type: TableType;
22 /**
23 * Specifies a default order by used for queries from this table when no explicit order by is specified.
24 */
25 orderBy?: OrderByCondition | ((object: any) => OrderByCondition | any);
26 /**
27 * Table's database engine type (like "InnoDB", "MyISAM", etc).
28 */
29 engine?: string;
30 /**
31 * Database name. Used in MySql and Sql Server.
32 */
33 database?: string;
34 /**
35 * Schema name. Used in Postgres and Sql Server.
36 */
37 schema?: string;
38 /**
39 * Indicates if schema synchronization is enabled or disabled for this entity.
40 * If it will be set to false then schema sync will and migrations ignore this entity.
41 * By default schema synchronization is enabled for all entities.
42 */
43 synchronize?: boolean;
44 /**
45 * View expression.
46 */
47 expression?: string | ((connection: Connection) => SelectQueryBuilder<any>);
48}
49
\No newline at end of file