333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { Connection, SelectQueryBuilder } from "..";
import { EntitySchemaIndexOptions } from "./EntitySchemaIndexOptions";
import { EntitySchemaColumnOptions } from "./EntitySchemaColumnOptions";
import { EntitySchemaRelationOptions } from "./EntitySchemaRelationOptions";
import { OrderByCondition } from "../find-options/OrderByCondition";
import { TableType } from "../metadata/types/TableTypes";
import { EntitySchemaUniqueOptions } from "./EntitySchemaUniqueOptions";
import { EntitySchemaCheckOptions } from "./EntitySchemaCheckOptions";
import { EntitySchemaExclusionOptions } from "./EntitySchemaExclusionOptions";
/**
 * Interface for entity metadata mappings stored inside "schemas" instead of models decorated by decorators.
 */
export declare class EntitySchemaOptions<T> {
    /**
     * Name of the schema it extends.
     */
    extends?: string;
    /**
     * Target bind to this entity schema. Optional.
     */
    target?: Function;
    /**
     * Entity name.
     */
    name: string;
    /**
     * Table name.
     */
    tableName?: string;
    /**
     * Database name. Used in MySql and Sql Server.
     */
    database?: string;
    /**
     * Schema name. Used in Postgres and Sql Server.
     */
    schema?: string;
    /**
     * Table type.
     */
    type?: TableType;
    /**
     * Specifies a property name by which queries will perform ordering by default when fetching rows.
     */
    orderBy?: OrderByCondition;
    /**
     * Entity column's options.
     */
    columns: {
        [P in keyof T]?: EntitySchemaColumnOptions;
    };
    /**
     * Entity relation's options.
     */
    relations?: {
        [P in keyof T]?: EntitySchemaRelationOptions;
    };
    /**
    * Entity indices options.
    */
    indices?: EntitySchemaIndexOptions[];
    /**
    * Entity uniques options.
    */
    uniques?: EntitySchemaUniqueOptions[];
    /**
    * Entity check options.
    */
    checks?: EntitySchemaCheckOptions[];
    /**
    * Entity exclusion options.
    */
    exclusions?: EntitySchemaExclusionOptions[];
    /**
     * Indicates if schema synchronization is enabled or disabled for this entity.
     * If it will be set to false then schema sync will and migrations ignore this entity.
     * By default schema synchronization is enabled for all entities.
     */
    synchronize?: boolean;
    /**
     * View expression.
     */
    expression?: string | ((connection: Connection) => SelectQueryBuilder<any>);
}