333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
{"version":3,"sources":["../../src/entity-schema/EntitySchemaOptions.ts"],"names":[],"mappings":";;AAUA;;GAEG;AACH;IAAA;IAwFA,CAAC;IAAD,0BAAC;AAAD,CAxFA,AAwFC,IAAA;AAxFY,kDAAmB","file":"EntitySchemaOptions.js","sourcesContent":["import {Connection, SelectQueryBuilder} from \"..\";\nimport {EntitySchemaIndexOptions} from \"./EntitySchemaIndexOptions\";\nimport {EntitySchemaColumnOptions} from \"./EntitySchemaColumnOptions\";\nimport {EntitySchemaRelationOptions} from \"./EntitySchemaRelationOptions\";\nimport {OrderByCondition} from \"../find-options/OrderByCondition\";\nimport {TableType} from \"../metadata/types/TableTypes\";\nimport {EntitySchemaUniqueOptions} from \"./EntitySchemaUniqueOptions\";\nimport {EntitySchemaCheckOptions} from \"./EntitySchemaCheckOptions\";\nimport {EntitySchemaExclusionOptions} from \"./EntitySchemaExclusionOptions\";\n\n/**\n * Interface for entity metadata mappings stored inside \"schemas\" instead of models decorated by decorators.\n */\nexport class EntitySchemaOptions<T> {\n\n    /**\n     * Name of the schema it extends.\n     */\n    extends?: string;\n\n    /**\n     * Target bind to this entity schema. Optional.\n     */\n    target?: Function;\n\n    /**\n     * Entity name.\n     */\n    name: string;\n\n    /**\n     * Table name.\n     */\n    tableName?: string;\n\n    /**\n     * Database name. Used in MySql and Sql Server.\n     */\n    database?: string;\n\n    /**\n     * Schema name. Used in Postgres and Sql Server.\n     */\n    schema?: string;\n\n    /**\n     * Table type.\n     */\n    type?: TableType;\n\n    /**\n     * Specifies a property name by which queries will perform ordering by default when fetching rows.\n     */\n    orderBy?: OrderByCondition;\n\n    /**\n     * Entity column's options.\n     */\n    columns: {\n        [P in keyof T]?: EntitySchemaColumnOptions;\n    };\n\n    /**\n     * Entity relation's options.\n     */\n    relations?: {\n        [P in keyof T]?: EntitySchemaRelationOptions;\n    };\n\n    /**\n    * Entity indices options.\n    */\n    indices?: EntitySchemaIndexOptions[];\n\n    /**\n    * Entity uniques options.\n    */\n    uniques?: EntitySchemaUniqueOptions[];\n\n    /**\n    * Entity check options.\n    */\n    checks?: EntitySchemaCheckOptions[];\n\n    /**\n    * Entity exclusion options.\n    */\n    exclusions?: EntitySchemaExclusionOptions[];\n\n    /**\n     * Indicates if schema synchronization is enabled or disabled for this entity.\n     * If it will be set to false then schema sync will and migrations ignore this entity.\n     * By default schema synchronization is enabled for all entities.\n     */\n    synchronize?: boolean;\n\n    /**\n     * View expression.\n     */\n    expression?: string|((connection: Connection) => SelectQueryBuilder<any>);\n\n}\n"],"sourceRoot":".."}