typeorm 0.3.11-dev.19536ed → 0.3.11-dev.1cb738a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js +0 -6
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.d.ts +17 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +97 -0
- package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/browser/driver/react-native/ReactNativeQueryRunner.js +4 -4
- package/browser/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js +6 -0
- package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
- package/browser/find-options/FindOperatorType.d.ts +1 -1
- package/browser/find-options/FindOperatorType.js.map +1 -1
- package/browser/find-options/FindOptionsOrder.d.ts +1 -1
- package/browser/find-options/FindOptionsOrder.js.map +1 -1
- package/browser/find-options/FindOptionsRelations.d.ts +1 -1
- package/browser/find-options/FindOptionsRelations.js.map +1 -1
- package/browser/find-options/FindOptionsSelect.d.ts +1 -1
- package/browser/find-options/FindOptionsSelect.js.map +1 -1
- package/browser/find-options/FindOptionsWhere.d.ts +2 -2
- package/browser/find-options/FindOptionsWhere.js.map +1 -1
- package/browser/find-options/operator/And.d.ts +2 -0
- package/browser/find-options/operator/And.js +6 -0
- package/browser/find-options/operator/And.js.map +1 -0
- package/browser/find-options/operator/Any.d.ts +1 -1
- package/browser/find-options/operator/Any.js.map +1 -1
- package/browser/find-options/operator/ArrayContainedBy.d.ts +1 -1
- package/browser/find-options/operator/ArrayContainedBy.js.map +1 -1
- package/browser/find-options/operator/ArrayContains.d.ts +1 -1
- package/browser/find-options/operator/ArrayContains.js.map +1 -1
- package/browser/find-options/operator/ArrayOverlap.d.ts +1 -1
- package/browser/find-options/operator/ArrayOverlap.js.map +1 -1
- package/browser/find-options/operator/In.d.ts +1 -1
- package/browser/find-options/operator/In.js.map +1 -1
- package/browser/index.d.ts +1 -0
- package/browser/index.js +1 -0
- package/browser/index.js.map +1 -1
- package/browser/naming-strategy/NamingStrategyInterface.d.ts +2 -1
- package/browser/naming-strategy/NamingStrategyInterface.js.map +1 -1
- package/browser/persistence/tree/MaterializedPathSubjectExecutor.d.ts +1 -0
- package/browser/persistence/tree/MaterializedPathSubjectExecutor.js +19 -4
- package/browser/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
- package/browser/query-builder/QueryBuilder.js +9 -0
- package/browser/query-builder/QueryBuilder.js.map +1 -1
- package/browser/query-builder/RelationLoader.js +1 -0
- package/browser/query-builder/RelationLoader.js.map +1 -1
- package/browser/query-builder/SelectQueryBuilder.js +1 -5
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/query-builder/WhereClause.d.ts +1 -1
- package/browser/query-builder/WhereClause.js.map +1 -1
- package/browser/query-runner/BaseQueryRunner.d.ts +1 -1
- package/browser/query-runner/BaseQueryRunner.js.map +1 -1
- package/browser/repository/Repository.d.ts +1 -1
- package/browser/repository/Repository.js.map +1 -1
- package/browser/repository/TreeRepository.d.ts +0 -4
- package/browser/repository/TreeRepository.js +0 -11
- package/browser/repository/TreeRepository.js.map +1 -1
- package/browser/schema-builder/RdbmsSchemaBuilder.d.ts +4 -0
- package/browser/schema-builder/RdbmsSchemaBuilder.js +74 -2
- package/browser/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/browser/schema-builder/view/View.d.ts +13 -1
- package/browser/schema-builder/view/View.js +16 -0
- package/browser/schema-builder/view/View.js.map +1 -1
- package/browser/util/TreeRepositoryUtils.js +16 -6
- package/browser/util/TreeRepositoryUtils.js.map +1 -1
- package/commands/MigrationRevertCommand.js +1 -0
- package/commands/MigrationRevertCommand.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js +0 -6
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.d.ts +17 -1
- package/driver/postgres/PostgresQueryRunner.js +97 -0
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/driver/react-native/ReactNativeQueryRunner.js +4 -4
- package/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteDriver.js +6 -0
- package/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
- package/find-options/FindOperatorType.d.ts +1 -1
- package/find-options/FindOperatorType.js.map +1 -1
- package/find-options/FindOptionsOrder.d.ts +1 -1
- package/find-options/FindOptionsOrder.js.map +1 -1
- package/find-options/FindOptionsRelations.d.ts +1 -1
- package/find-options/FindOptionsRelations.js.map +1 -1
- package/find-options/FindOptionsSelect.d.ts +1 -1
- package/find-options/FindOptionsSelect.js.map +1 -1
- package/find-options/FindOptionsWhere.d.ts +2 -2
- package/find-options/FindOptionsWhere.js.map +1 -1
- package/find-options/operator/And.d.ts +2 -0
- package/find-options/operator/And.js +10 -0
- package/find-options/operator/And.js.map +1 -0
- package/find-options/operator/Any.d.ts +1 -1
- package/find-options/operator/Any.js.map +1 -1
- package/find-options/operator/ArrayContainedBy.d.ts +1 -1
- package/find-options/operator/ArrayContainedBy.js.map +1 -1
- package/find-options/operator/ArrayContains.d.ts +1 -1
- package/find-options/operator/ArrayContains.js.map +1 -1
- package/find-options/operator/ArrayOverlap.d.ts +1 -1
- package/find-options/operator/ArrayOverlap.js.map +1 -1
- package/find-options/operator/In.d.ts +1 -1
- package/find-options/operator/In.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/index.mjs +2 -0
- package/naming-strategy/NamingStrategyInterface.d.ts +2 -1
- package/naming-strategy/NamingStrategyInterface.js.map +1 -1
- package/package.json +1 -1
- package/persistence/tree/MaterializedPathSubjectExecutor.d.ts +1 -0
- package/persistence/tree/MaterializedPathSubjectExecutor.js +19 -4
- package/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
- package/query-builder/QueryBuilder.js +9 -0
- package/query-builder/QueryBuilder.js.map +1 -1
- package/query-builder/RelationLoader.js +1 -0
- package/query-builder/RelationLoader.js.map +1 -1
- package/query-builder/SelectQueryBuilder.js +1 -5
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/query-builder/WhereClause.d.ts +1 -1
- package/query-builder/WhereClause.js.map +1 -1
- package/query-runner/BaseQueryRunner.d.ts +1 -1
- package/query-runner/BaseQueryRunner.js.map +1 -1
- package/repository/Repository.d.ts +1 -1
- package/repository/Repository.js.map +1 -1
- package/repository/TreeRepository.d.ts +0 -4
- package/repository/TreeRepository.js +0 -11
- package/repository/TreeRepository.js.map +1 -1
- package/schema-builder/RdbmsSchemaBuilder.d.ts +4 -0
- package/schema-builder/RdbmsSchemaBuilder.js +74 -2
- package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/schema-builder/view/View.d.ts +13 -1
- package/schema-builder/view/View.js +16 -0
- package/schema-builder/view/View.js.map +1 -1
- package/util/TreeRepositoryUtils.js +16 -6
- package/util/TreeRepositoryUtils.js.map +1 -1
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA;GACG;AACH,4BAAyB;AAEzB,4EAA4E;AAC5E,wBAAwB;AACxB,4EAA4E;AAE5E,oDAAyB;AACzB,sDAA2B;AAC3B,gEAAqC;AACrC,8DAAmC;AACnC,iEAAsC;AACtC,6DAAkC;AAClC,+DAAoC;AACpC,gEAAqC;AACrC,kDAAuB;AACvB,qEAA0C;AAC1C,+EAAoD;AACpD,+EAAoD;AACpD,qFAA0D;AAC1D,4EAAiD;AACjD,+EAAoD;AACpD,4EAAiD;AACjD,4EAAiD;AACjD,yEAA8C;AAC9C,6EAAkD;AAClD,4EAAiD;AACjD,0EAA+C;AAC/C,4EAAiD;AACjD,gFAAqD;AACrD,6EAAk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AmB,OAAA;AAC5B,0DAAwD;AAA/C,kHAAA,eAAe,OAAA;AACxB,kEAAgE;AAAvD,0HAAA,mBAAmB,OAAA","file":"index.js","sourcesContent":["/*!\n */\nimport \"reflect-metadata\"\n\n// -------------------------------------------------------------------------\n// Commonly Used exports\n// -------------------------------------------------------------------------\n\nexport * from \"./globals\"\nexport * from \"./container\"\nexport * from \"./common/EntityTarget\"\nexport * from \"./common/ObjectType\"\nexport * from \"./common/ObjectLiteral\"\nexport * from \"./common/MixedList\"\nexport * from \"./common/DeepPartial\"\nexport * from \"./common/RelationType\"\nexport * from \"./error\"\nexport * from \"./decorator/columns/Column\"\nexport * from \"./decorator/columns/CreateDateColumn\"\nexport * from \"./decorator/columns/DeleteDateColumn\"\nexport * from \"./decorator/columns/PrimaryGeneratedColumn\"\nexport * from \"./decorator/columns/PrimaryColumn\"\nexport * from \"./decorator/columns/UpdateDateColumn\"\nexport * from \"./decorator/columns/VersionColumn\"\nexport * from \"./decorator/columns/VirtualColumn\"\nexport * from \"./decorator/columns/ViewColumn\"\nexport * from \"./decorator/columns/ObjectIdColumn\"\nexport * from \"./decorator/listeners/AfterInsert\"\nexport * from \"./decorator/listeners/AfterLoad\"\nexport * from \"./decorator/listeners/AfterRemove\"\nexport * from \"./decorator/listeners/AfterSoftRemove\"\nexport * from \"./decorator/listeners/AfterRecover\"\nexport * from \"./decorator/listeners/AfterUpdate\"\nexport * from \"./decorator/listeners/BeforeInsert\"\nexport * from \"./decorator/listeners/BeforeRemove\"\nexport * from \"./decorator/listeners/BeforeSoftRemove\"\nexport * from \"./decorator/listeners/BeforeRecover\"\nexport * from \"./decorator/listeners/BeforeUpdate\"\nexport * from \"./decorator/listeners/EventSubscriber\"\nexport * from \"./decorator/options/ColumnOptions\"\nexport * from \"./decorator/options/IndexOptions\"\nexport * from \"./decorator/options/JoinColumnOptions\"\nexport * from \"./decorator/options/JoinTableOptions\"\nexport * from \"./decorator/options/RelationOptions\"\nexport * from \"./decorator/options/EntityOptions\"\nexport * from \"./decorator/options/ValueTransformer\"\nexport * from \"./decorator/relations/JoinColumn\"\nexport * from \"./decorator/relations/JoinTable\"\nexport * from \"./decorator/relations/ManyToMany\"\nexport * from \"./decorator/relations/ManyToOne\"\nexport * from \"./decorator/relations/OneToMany\"\nexport * from \"./decorator/relations/OneToOne\"\nexport * from \"./decorator/relations/RelationCount\"\nexport * from \"./decorator/relations/RelationId\"\nexport * from \"./decorator/entity/Entity\"\nexport * from \"./decorator/entity/ChildEntity\"\nexport * from \"./decorator/entity/TableInheritance\"\nexport * from \"./decorator/entity-view/ViewEntity\"\nexport * from \"./decorator/tree/TreeLevelColumn\"\nexport * from \"./decorator/tree/TreeParent\"\nexport * from \"./decorator/tree/TreeChildren\"\nexport * from \"./decorator/tree/Tree\"\nexport * from \"./decorator/Index\"\nexport * from \"./decorator/Unique\"\nexport * from \"./decorator/Check\"\nexport * from \"./decorator/Exclusion\"\nexport * from \"./decorator/Generated\"\nexport * from \"./decorator/EntityRepository\"\nexport * from \"./find-options/operator/Any\"\nexport * from \"./find-options/operator/ArrayContainedBy\"\nexport * from \"./find-options/operator/ArrayContains\"\nexport * from \"./find-options/operator/ArrayOverlap\"\nexport * from \"./find-options/operator/Between\"\nexport * from \"./find-options/operator/Equal\"\nexport * from \"./find-options/operator/In\"\nexport * from \"./find-options/operator/IsNull\"\nexport * from \"./find-options/operator/LessThan\"\nexport * from \"./find-options/operator/LessThanOrEqual\"\nexport * from \"./find-options/operator/ILike\"\nexport * from \"./find-options/operator/Like\"\nexport * from \"./find-options/operator/MoreThan\"\nexport * from \"./find-options/operator/MoreThanOrEqual\"\nexport * from \"./find-options/operator/Not\"\nexport * from \"./find-options/operator/Raw\"\nexport * from \"./find-options/EqualOperator\"\nexport * from \"./find-options/FindManyOptions\"\nexport * from \"./find-options/FindOneOptions\"\nexport * from \"./find-options/FindOperator\"\nexport * from \"./find-options/FindOperatorType\"\nexport * from \"./find-options/FindOptionsOrder\"\nexport * from \"./find-options/FindOptionsRelations\"\nexport * from \"./find-options/FindOptionsSelect\"\nexport * from \"./find-options/FindOptionsUtils\"\nexport * from \"./find-options/FindOptionsWhere\"\nexport * from \"./find-options/FindTreeOptions\"\nexport * from \"./find-options/JoinOptions\"\nexport * from \"./find-options/OrderByCondition\"\nexport * from \"./logger/Logger\"\nexport * from \"./logger/LoggerOptions\"\nexport * from \"./logger/AdvancedConsoleLogger\"\nexport * from \"./logger/SimpleConsoleLogger\"\nexport * from \"./logger/FileLogger\"\nexport * from \"./metadata/EntityMetadata\"\nexport * from \"./entity-manager/EntityManager\"\nexport * from \"./repository/AbstractRepository\"\nexport * from \"./repository/Repository\"\nexport * from \"./repository/BaseEntity\"\nexport * from \"./repository/TreeRepository\"\nexport * from \"./repository/MongoRepository\"\nexport * from \"./repository/RemoveOptions\"\nexport * from \"./repository/SaveOptions\"\nexport * from \"./schema-builder/table/TableCheck\"\nexport * from \"./schema-builder/table/TableColumn\"\nexport * from \"./schema-builder/table/TableExclusion\"\nexport * from \"./schema-builder/table/TableForeignKey\"\nexport * from \"./schema-builder/table/TableIndex\"\nexport * from \"./schema-builder/table/TableUnique\"\nexport * from \"./schema-builder/table/Table\"\nexport * from \"./schema-builder/options/TableCheckOptions\"\nexport * from \"./schema-builder/options/TableColumnOptions\"\nexport * from \"./schema-builder/options/TableExclusionOptions\"\nexport * from \"./schema-builder/options/TableForeignKeyOptions\"\nexport * from \"./schema-builder/options/TableIndexOptions\"\nexport * from \"./schema-builder/options/TableOptions\"\nexport * from \"./schema-builder/options/TableUniqueOptions\"\nexport * from \"./schema-builder/options/ViewOptions\"\nexport * from \"./driver/mongodb/typings\"\nexport * from \"./driver/types/DatabaseType\"\nexport * from \"./driver/types/ReplicationMode\"\nexport * from \"./driver/sqlserver/MssqlParameter\"\n\n// export * from \"./data-source\";\n\nexport { ConnectionOptionsReader } from \"./connection/ConnectionOptionsReader\"\nexport { ConnectionOptions } from \"./connection/ConnectionOptions\"\nexport { DataSource } from \"./data-source/DataSource\"\nexport { Connection } from \"./connection/Connection\"\nexport { ConnectionManager } from \"./connection/ConnectionManager\"\nexport { DataSourceOptions } from \"./data-source/DataSourceOptions\"\nexport { Driver } from \"./driver/Driver\"\nexport { QueryBuilder } from \"./query-builder/QueryBuilder\"\nexport { SelectQueryBuilder } from \"./query-builder/SelectQueryBuilder\"\nexport { DeleteQueryBuilder } from \"./query-builder/DeleteQueryBuilder\"\nexport { InsertQueryBuilder } from \"./query-builder/InsertQueryBuilder\"\nexport { UpdateQueryBuilder } from \"./query-builder/UpdateQueryBuilder\"\nexport { RelationQueryBuilder } from \"./query-builder/RelationQueryBuilder\"\nexport { Brackets } from \"./query-builder/Brackets\"\nexport { NotBrackets } from \"./query-builder/NotBrackets\"\nexport { WhereExpressionBuilder } from \"./query-builder/WhereExpressionBuilder\"\nexport { WhereExpression } from \"./query-builder/WhereExpressionBuilder\"\nexport { InsertResult } from \"./query-builder/result/InsertResult\"\nexport { UpdateResult } from \"./query-builder/result/UpdateResult\"\nexport { DeleteResult } from \"./query-builder/result/DeleteResult\"\nexport { QueryResult } from \"./query-runner/QueryResult\"\nexport { QueryRunner } from \"./query-runner/QueryRunner\"\nexport { MongoEntityManager } from \"./entity-manager/MongoEntityManager\"\nexport { Migration } from \"./migration/Migration\"\nexport { MigrationExecutor } from \"./migration/MigrationExecutor\"\nexport { MigrationInterface } from \"./migration/MigrationInterface\"\nexport { DefaultNamingStrategy } from \"./naming-strategy/DefaultNamingStrategy\"\nexport { NamingStrategyInterface } from \"./naming-strategy/NamingStrategyInterface\"\nexport { InsertEvent } from \"./subscriber/event/InsertEvent\"\nexport { LoadEvent } from \"./subscriber/event/LoadEvent\"\nexport { UpdateEvent } from \"./subscriber/event/UpdateEvent\"\nexport { RemoveEvent } from \"./subscriber/event/RemoveEvent\"\nexport { SoftRemoveEvent } from \"./subscriber/event/SoftRemoveEvent\"\nexport { RecoverEvent } from \"./subscriber/event/RecoverEvent\"\nexport { TransactionCommitEvent } from \"./subscriber/event/TransactionCommitEvent\"\nexport { TransactionRollbackEvent } from \"./subscriber/event/TransactionRollbackEvent\"\nexport { TransactionStartEvent } from \"./subscriber/event/TransactionStartEvent\"\nexport { EntitySubscriberInterface } from \"./subscriber/EntitySubscriberInterface\"\nexport { EntitySchema } from \"./entity-schema/EntitySchema\"\nexport { EntitySchemaColumnOptions } from \"./entity-schema/EntitySchemaColumnOptions\"\nexport { EntitySchemaIndexOptions } from \"./entity-schema/EntitySchemaIndexOptions\"\nexport { EntitySchemaRelationOptions } from \"./entity-schema/EntitySchemaRelationOptions\"\nexport { EntitySchemaEmbeddedColumnOptions } from \"./entity-schema/EntitySchemaEmbeddedColumnOptions\"\nexport { ColumnType } from \"./driver/types/ColumnTypes\"\nexport { EntitySchemaOptions } from \"./entity-schema/EntitySchemaOptions\"\nexport { InstanceChecker } from \"./util/InstanceChecker\"\nexport { TreeRepositoryUtils } from \"./util/TreeRepositoryUtils\"\n"],"sourceRoot":"."}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA;GACG;AACH,4BAAyB;AAEzB,4EAA4E;AAC5E,wBAAwB;AACxB,4EAA4E;AAE5E,oDAAyB;AACzB,sDAA2B;AAC3B,gEAAqC;AACrC,8DAAmC;AACnC,iEAAsC;AACtC,6DAAkC;AAClC,+DAAoC;AACpC,gEAAqC;AACrC,kDAAuB;AACvB,qEAA0C;AAC1C,+EAAoD;AACpD,+EAAoD;AACpD,qFAA0D;AAC1D,4EAAiD;AACjD,+EAAoD;AACpD,4EAAiD;AACjD,4EAAiD;AACjD,yEAA8C;AAC9C,6EAAkD;AAClD,4EAAiD;AACjD,0EAA+C;AAC/C,4EAAiD;AACjD,gFAAqD;AACrD,6EAAkD;AAClD,4EAAiD;AACjD,6EAAkD;AAClD,6EAAkD;AAClD,iFAAsD;AACtD,8EAAmD;AACnD,6EAAkD;AAClD,gFAAqD;AACrD,4EAAiD;AACjD,2EAAgD;AAChD,gFAAqD;AACrD,+EAAoD;AACpD,8EAA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------------------------\n// Commonly Used exports\n// -------------------------------------------------------------------------\n\nexport * from \"./globals\"\nexport * from \"./container\"\nexport * from \"./common/EntityTarget\"\nexport * from \"./common/ObjectType\"\nexport * from \"./common/ObjectLiteral\"\nexport * from \"./common/MixedList\"\nexport * from \"./common/DeepPartial\"\nexport * from \"./common/RelationType\"\nexport * from \"./error\"\nexport * from \"./decorator/columns/Column\"\nexport * from \"./decorator/columns/CreateDateColumn\"\nexport * from \"./decorator/columns/DeleteDateColumn\"\nexport * from \"./decorator/columns/PrimaryGeneratedColumn\"\nexport * from \"./decorator/columns/PrimaryColumn\"\nexport * from \"./decorator/columns/UpdateDateColumn\"\nexport * from \"./decorator/columns/VersionColumn\"\nexport * from \"./decorator/columns/VirtualColumn\"\nexport * from \"./decorator/columns/ViewColumn\"\nexport * from \"./decorator/columns/ObjectIdColumn\"\nexport * from \"./decorator/listeners/AfterInsert\"\nexport * from \"./decorator/listeners/AfterLoad\"\nexport * from \"./decorator/listeners/AfterRemove\"\nexport * from \"./decorator/listeners/AfterSoftRemove\"\nexport * from \"./decorator/listeners/AfterRecover\"\nexport * from \"./decorator/listeners/AfterUpdate\"\nexport * from \"./decorator/listeners/BeforeInsert\"\nexport * from \"./decorator/listeners/BeforeRemove\"\nexport * from \"./decorator/listeners/BeforeSoftRemove\"\nexport * from \"./decorator/listeners/BeforeRecover\"\nexport * from \"./decorator/listeners/BeforeUpdate\"\nexport * from \"./decorator/listeners/EventSubscriber\"\nexport * from \"./decorator/options/ColumnOptions\"\nexport * from \"./decorator/options/IndexOptions\"\nexport * from \"./decorator/options/JoinColumnOptions\"\nexport * from \"./decorator/options/JoinTableOptions\"\nexport * from \"./decorator/options/RelationOptions\"\nexport * from \"./decorator/options/EntityOptions\"\nexport * from \"./decorator/options/ValueTransformer\"\nexport * from \"./decorator/relations/JoinColumn\"\nexport * from \"./decorator/relations/JoinTable\"\nexport * from \"./decorator/relations/ManyToMany\"\nexport * from \"./decorator/relations/ManyToOne\"\nexport * from \"./decorator/relations/OneToMany\"\nexport * from \"./decorator/relations/OneToOne\"\nexport * from \"./decorator/relations/RelationCount\"\nexport * from \"./decorator/relations/RelationId\"\nexport * from \"./decorator/entity/Entity\"\nexport * from \"./decorator/entity/ChildEntity\"\nexport * from \"./decorator/entity/TableInheritance\"\nexport * from \"./decorator/entity-view/ViewEntity\"\nexport * from \"./decorator/tree/TreeLevelColumn\"\nexport * from \"./decorator/tree/TreeParent\"\nexport * from \"./decorator/tree/TreeChildren\"\nexport * from \"./decorator/tree/Tree\"\nexport * from \"./decorator/Index\"\nexport * from \"./decorator/Unique\"\nexport * from \"./decorator/Check\"\nexport * from \"./decorator/Exclusion\"\nexport * from \"./decorator/Generated\"\nexport * from \"./decorator/EntityRepository\"\nexport * from \"./find-options/operator/And\"\nexport * from \"./find-options/operator/Any\"\nexport * from \"./find-options/operator/ArrayContainedBy\"\nexport * from \"./find-options/operator/ArrayContains\"\nexport * from \"./find-options/operator/ArrayOverlap\"\nexport * from \"./find-options/operator/Between\"\nexport * from \"./find-options/operator/Equal\"\nexport * from \"./find-options/operator/In\"\nexport * from \"./find-options/operator/IsNull\"\nexport * from \"./find-options/operator/LessThan\"\nexport * from \"./find-options/operator/LessThanOrEqual\"\nexport * from \"./find-options/operator/ILike\"\nexport * from \"./find-options/operator/Like\"\nexport * from \"./find-options/operator/MoreThan\"\nexport * from \"./find-options/operator/MoreThanOrEqual\"\nexport * from \"./find-options/operator/Not\"\nexport * from \"./find-options/operator/Raw\"\nexport * from \"./find-options/EqualOperator\"\nexport * from \"./find-options/FindManyOptions\"\nexport * from \"./find-options/FindOneOptions\"\nexport * from \"./find-options/FindOperator\"\nexport * from \"./find-options/FindOperatorType\"\nexport * from \"./find-options/FindOptionsOrder\"\nexport * from \"./find-options/FindOptionsRelations\"\nexport * from \"./find-options/FindOptionsSelect\"\nexport * from \"./find-options/FindOptionsUtils\"\nexport * from \"./find-options/FindOptionsWhere\"\nexport * from \"./find-options/FindTreeOptions\"\nexport * from \"./find-options/JoinOptions\"\nexport * from \"./find-options/OrderByCondition\"\nexport * from \"./logger/Logger\"\nexport * from \"./logger/LoggerOptions\"\nexport * from \"./logger/AdvancedConsoleLogger\"\nexport * from \"./logger/SimpleConsoleLogger\"\nexport * from \"./logger/FileLogger\"\nexport * from \"./metadata/EntityMetadata\"\nexport * from \"./entity-manager/EntityManager\"\nexport * from \"./repository/AbstractRepository\"\nexport * from \"./repository/Repository\"\nexport * from \"./repository/BaseEntity\"\nexport * from \"./repository/TreeRepository\"\nexport * from \"./repository/MongoRepository\"\nexport * from \"./repository/RemoveOptions\"\nexport * from \"./repository/SaveOptions\"\nexport * from \"./schema-builder/table/TableCheck\"\nexport * from \"./schema-builder/table/TableColumn\"\nexport * from \"./schema-builder/table/TableExclusion\"\nexport * from \"./schema-builder/table/TableForeignKey\"\nexport * from \"./schema-builder/table/TableIndex\"\nexport * from \"./schema-builder/table/TableUnique\"\nexport * from \"./schema-builder/table/Table\"\nexport * from \"./schema-builder/options/TableCheckOptions\"\nexport * from \"./schema-builder/options/TableColumnOptions\"\nexport * from \"./schema-builder/options/TableExclusionOptions\"\nexport * from \"./schema-builder/options/TableForeignKeyOptions\"\nexport * from \"./schema-builder/options/TableIndexOptions\"\nexport * from \"./schema-builder/options/TableOptions\"\nexport * from \"./schema-builder/options/TableUniqueOptions\"\nexport * from \"./schema-builder/options/ViewOptions\"\nexport * from \"./driver/mongodb/typings\"\nexport * from \"./driver/types/DatabaseType\"\nexport * from \"./driver/types/ReplicationMode\"\nexport * from \"./driver/sqlserver/MssqlParameter\"\n\n// export * from \"./data-source\";\n\nexport { ConnectionOptionsReader } from \"./connection/ConnectionOptionsReader\"\nexport { ConnectionOptions } from \"./connection/ConnectionOptions\"\nexport { DataSource } from \"./data-source/DataSource\"\nexport { Connection } from \"./connection/Connection\"\nexport { ConnectionManager } from \"./connection/ConnectionManager\"\nexport { DataSourceOptions } from \"./data-source/DataSourceOptions\"\nexport { Driver } from \"./driver/Driver\"\nexport { QueryBuilder } from \"./query-builder/QueryBuilder\"\nexport { SelectQueryBuilder } from \"./query-builder/SelectQueryBuilder\"\nexport { DeleteQueryBuilder } from \"./query-builder/DeleteQueryBuilder\"\nexport { InsertQueryBuilder } from \"./query-builder/InsertQueryBuilder\"\nexport { UpdateQueryBuilder } from \"./query-builder/UpdateQueryBuilder\"\nexport { RelationQueryBuilder } from \"./query-builder/RelationQueryBuilder\"\nexport { Brackets } from \"./query-builder/Brackets\"\nexport { NotBrackets } from \"./query-builder/NotBrackets\"\nexport { WhereExpressionBuilder } from \"./query-builder/WhereExpressionBuilder\"\nexport { WhereExpression } from \"./query-builder/WhereExpressionBuilder\"\nexport { InsertResult } from \"./query-builder/result/InsertResult\"\nexport { UpdateResult } from \"./query-builder/result/UpdateResult\"\nexport { DeleteResult } from \"./query-builder/result/DeleteResult\"\nexport { QueryResult } from \"./query-runner/QueryResult\"\nexport { QueryRunner } from \"./query-runner/QueryRunner\"\nexport { MongoEntityManager } from \"./entity-manager/MongoEntityManager\"\nexport { Migration } from \"./migration/Migration\"\nexport { MigrationExecutor } from \"./migration/MigrationExecutor\"\nexport { MigrationInterface } from \"./migration/MigrationInterface\"\nexport { DefaultNamingStrategy } from \"./naming-strategy/DefaultNamingStrategy\"\nexport { NamingStrategyInterface } from \"./naming-strategy/NamingStrategyInterface\"\nexport { InsertEvent } from \"./subscriber/event/InsertEvent\"\nexport { LoadEvent } from \"./subscriber/event/LoadEvent\"\nexport { UpdateEvent } from \"./subscriber/event/UpdateEvent\"\nexport { RemoveEvent } from \"./subscriber/event/RemoveEvent\"\nexport { SoftRemoveEvent } from \"./subscriber/event/SoftRemoveEvent\"\nexport { RecoverEvent } from \"./subscriber/event/RecoverEvent\"\nexport { TransactionCommitEvent } from \"./subscriber/event/TransactionCommitEvent\"\nexport { TransactionRollbackEvent } from \"./subscriber/event/TransactionRollbackEvent\"\nexport { TransactionStartEvent } from \"./subscriber/event/TransactionStartEvent\"\nexport { EntitySubscriberInterface } from \"./subscriber/EntitySubscriberInterface\"\nexport { EntitySchema } from \"./entity-schema/EntitySchema\"\nexport { EntitySchemaColumnOptions } from \"./entity-schema/EntitySchemaColumnOptions\"\nexport { EntitySchemaIndexOptions } from \"./entity-schema/EntitySchemaIndexOptions\"\nexport { EntitySchemaRelationOptions } from \"./entity-schema/EntitySchemaRelationOptions\"\nexport { EntitySchemaEmbeddedColumnOptions } from \"./entity-schema/EntitySchemaEmbeddedColumnOptions\"\nexport { ColumnType } from \"./driver/types/ColumnTypes\"\nexport { EntitySchemaOptions } from \"./entity-schema/EntitySchemaOptions\"\nexport { InstanceChecker } from \"./util/InstanceChecker\"\nexport { TreeRepositoryUtils } from \"./util/TreeRepositoryUtils\"\n"],"sourceRoot":"."}
|
package/index.mjs
CHANGED
|
@@ -146,6 +146,7 @@ const {
|
|
|
146
146
|
Exclusion,
|
|
147
147
|
Generated,
|
|
148
148
|
EntityRepository,
|
|
149
|
+
And,
|
|
149
150
|
Any,
|
|
150
151
|
ArrayContainedBy,
|
|
151
152
|
ArrayContains,
|
|
@@ -331,6 +332,7 @@ export {
|
|
|
331
332
|
Exclusion,
|
|
332
333
|
Generated,
|
|
333
334
|
EntityRepository,
|
|
335
|
+
And,
|
|
334
336
|
Any,
|
|
335
337
|
ArrayContainedBy,
|
|
336
338
|
ArrayContains,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Table } from "../schema-builder/table/Table";
|
|
2
|
+
import { View } from "../schema-builder/view/View";
|
|
2
3
|
/**
|
|
3
4
|
* Naming strategy defines how auto-generated names for such things like table name, or table column gonna be
|
|
4
5
|
* generated.
|
|
@@ -53,7 +54,7 @@ export interface NamingStrategyInterface {
|
|
|
53
54
|
/**
|
|
54
55
|
* Gets the name of the index - simple and compose index.
|
|
55
56
|
*/
|
|
56
|
-
indexName(tableOrName: Table | string, columns: string[], where?: string): string;
|
|
57
|
+
indexName(tableOrName: Table | View | string, columns: string[], where?: string): string;
|
|
57
58
|
/**
|
|
58
59
|
* Gets the name of the check constraint.
|
|
59
60
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/naming-strategy/NamingStrategyInterface.ts"],"names":[],"mappings":"","file":"NamingStrategyInterface.js","sourcesContent":["import { Table } from \"../schema-builder/table/Table\"\n\n/**\n * Naming strategy defines how auto-generated names for such things like table name, or table column gonna be\n * generated.\n */\nexport interface NamingStrategyInterface {\n /**\n * Naming strategy name.\n */\n name?: string\n\n /**\n * Normalizes table name.\n *\n * @param targetName Name of the target entity that can be used to generate a table name.\n * @param userSpecifiedName For example if user specified a table name in a decorator, e.g. @Entity(\"name\")\n */\n tableName(targetName: string, userSpecifiedName: string | undefined): string\n\n /**\n * Creates a table name for a junction table of a closure table.\n *\n * @param originalClosureTableName Name of the closure table which owns this junction table.\n */\n closureJunctionTableName(originalClosureTableName: string): string\n\n /**\n * Gets the table's column name from the given property name.\n */\n columnName(\n propertyName: string,\n customName: string | undefined,\n embeddedPrefixes: string[],\n ): string\n\n /**\n * Gets the table's relation name from the given property name.\n */\n relationName(propertyName: string): string\n\n /**\n * Gets the table's primary key name from the given table name and column names.\n */\n primaryKeyName(tableOrName: Table | string, columnNames: string[]): string\n\n /**\n * Gets the table's unique constraint name from the given table name and column names.\n */\n uniqueConstraintName(\n tableOrName: Table | string,\n columnNames: string[],\n ): string\n\n /**\n * Gets the relation constraint (UNIQUE or UNIQUE INDEX) name from the given table name, column names\n * and WHERE condition, if UNIQUE INDEX used.\n */\n relationConstraintName(\n tableOrName: Table | string,\n columnNames: string[],\n where?: string,\n ): string\n\n /**\n * Gets the table's default constraint name from the given table name and column name.\n */\n defaultConstraintName(\n tableOrName: Table | string,\n columnName: string,\n ): string\n\n /**\n * Gets the name of the foreign key.\n */\n foreignKeyName(\n tableOrName: Table | string,\n columnNames: string[],\n referencedTablePath?: string,\n referencedColumnNames?: string[],\n ): string\n\n /**\n * Gets the name of the index - simple and compose index.\n */\n indexName(\n tableOrName: Table | string,\n columns: string[],\n where?: string,\n ): string\n\n /**\n * Gets the name of the check constraint.\n *\n * \"isEnum\" parameter is used to indicate if this check constraint used\n * to handle \"simple-enum\" type for databases that are not supporting \"enum\"\n * type out of the box. If \"true\", constraint is ignored during CHECK constraints\n * synchronization.\n */\n checkConstraintName(\n tableOrName: Table | string,\n expression: string,\n isEnum?: boolean,\n ): string\n\n /**\n * Gets the name of the exclusion constraint.\n */\n exclusionConstraintName(\n tableOrName: Table | string,\n expression: string,\n ): string\n\n /**\n * Gets the name of the join column used in the one-to-one and many-to-one relations.\n */\n joinColumnName(relationName: string, referencedColumnName: string): string\n\n /**\n * Gets the name of the join table used in the many-to-many relations.\n */\n joinTableName(\n firstTableName: string,\n secondTableName: string,\n firstPropertyName: string,\n secondPropertyName: string,\n ): string\n\n /**\n * Columns in join tables can have duplicate names in case of self-referencing.\n * This method provide a resolution for such column names.\n */\n joinTableColumnDuplicationPrefix(columnName: string, index: number): string\n\n /**\n * Gets the name of the column used for columns in the junction tables.\n *\n * The reverse?:boolean parameter denotes if the joinTableColumnName is called for the junctionColumn (false)\n * or the inverseJunctionColumns (true)\n */\n joinTableColumnName(\n tableName: string,\n propertyName: string,\n columnName?: string,\n ): string\n\n /**\n * Gets the name of the column used for columns in the junction tables from the invers side of the relationship.\n */\n joinTableInverseColumnName(\n tableName: string,\n propertyName: string,\n columnName?: string,\n ): string\n\n /**\n * Adds globally set prefix to the table name.\n * This method is executed no matter if prefix was set or not.\n * Table name is either user's given table name, either name generated from entity target.\n * Note that table name comes here already normalized by #tableName method.\n */\n prefixTableName(prefix: string, tableName: string): string\n\n /**\n * Gets the name of the alias used for relation joins.\n */\n eagerJoinRelationAlias(alias: string, propertyPath: string): string\n\n /**\n * Column names for nested sets.\n */\n nestedSetColumnNames: { left: string; right: string }\n\n /**\n * Column name for materialized paths.\n */\n materializedPathColumnName: string\n}\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../../src/naming-strategy/NamingStrategyInterface.ts"],"names":[],"mappings":"","file":"NamingStrategyInterface.js","sourcesContent":["import { Table } from \"../schema-builder/table/Table\"\nimport { View } from \"../schema-builder/view/View\"\n\n/**\n * Naming strategy defines how auto-generated names for such things like table name, or table column gonna be\n * generated.\n */\nexport interface NamingStrategyInterface {\n /**\n * Naming strategy name.\n */\n name?: string\n\n /**\n * Normalizes table name.\n *\n * @param targetName Name of the target entity that can be used to generate a table name.\n * @param userSpecifiedName For example if user specified a table name in a decorator, e.g. @Entity(\"name\")\n */\n tableName(targetName: string, userSpecifiedName: string | undefined): string\n\n /**\n * Creates a table name for a junction table of a closure table.\n *\n * @param originalClosureTableName Name of the closure table which owns this junction table.\n */\n closureJunctionTableName(originalClosureTableName: string): string\n\n /**\n * Gets the table's column name from the given property name.\n */\n columnName(\n propertyName: string,\n customName: string | undefined,\n embeddedPrefixes: string[],\n ): string\n\n /**\n * Gets the table's relation name from the given property name.\n */\n relationName(propertyName: string): string\n\n /**\n * Gets the table's primary key name from the given table name and column names.\n */\n primaryKeyName(tableOrName: Table | string, columnNames: string[]): string\n\n /**\n * Gets the table's unique constraint name from the given table name and column names.\n */\n uniqueConstraintName(\n tableOrName: Table | string,\n columnNames: string[],\n ): string\n\n /**\n * Gets the relation constraint (UNIQUE or UNIQUE INDEX) name from the given table name, column names\n * and WHERE condition, if UNIQUE INDEX used.\n */\n relationConstraintName(\n tableOrName: Table | string,\n columnNames: string[],\n where?: string,\n ): string\n\n /**\n * Gets the table's default constraint name from the given table name and column name.\n */\n defaultConstraintName(\n tableOrName: Table | string,\n columnName: string,\n ): string\n\n /**\n * Gets the name of the foreign key.\n */\n foreignKeyName(\n tableOrName: Table | string,\n columnNames: string[],\n referencedTablePath?: string,\n referencedColumnNames?: string[],\n ): string\n\n /**\n * Gets the name of the index - simple and compose index.\n */\n indexName(\n tableOrName: Table | View | string,\n columns: string[],\n where?: string,\n ): string\n\n /**\n * Gets the name of the check constraint.\n *\n * \"isEnum\" parameter is used to indicate if this check constraint used\n * to handle \"simple-enum\" type for databases that are not supporting \"enum\"\n * type out of the box. If \"true\", constraint is ignored during CHECK constraints\n * synchronization.\n */\n checkConstraintName(\n tableOrName: Table | string,\n expression: string,\n isEnum?: boolean,\n ): string\n\n /**\n * Gets the name of the exclusion constraint.\n */\n exclusionConstraintName(\n tableOrName: Table | string,\n expression: string,\n ): string\n\n /**\n * Gets the name of the join column used in the one-to-one and many-to-one relations.\n */\n joinColumnName(relationName: string, referencedColumnName: string): string\n\n /**\n * Gets the name of the join table used in the many-to-many relations.\n */\n joinTableName(\n firstTableName: string,\n secondTableName: string,\n firstPropertyName: string,\n secondPropertyName: string,\n ): string\n\n /**\n * Columns in join tables can have duplicate names in case of self-referencing.\n * This method provide a resolution for such column names.\n */\n joinTableColumnDuplicationPrefix(columnName: string, index: number): string\n\n /**\n * Gets the name of the column used for columns in the junction tables.\n *\n * The reverse?:boolean parameter denotes if the joinTableColumnName is called for the junctionColumn (false)\n * or the inverseJunctionColumns (true)\n */\n joinTableColumnName(\n tableName: string,\n propertyName: string,\n columnName?: string,\n ): string\n\n /**\n * Gets the name of the column used for columns in the junction tables from the invers side of the relationship.\n */\n joinTableInverseColumnName(\n tableName: string,\n propertyName: string,\n columnName?: string,\n ): string\n\n /**\n * Adds globally set prefix to the table name.\n * This method is executed no matter if prefix was set or not.\n * Table name is either user's given table name, either name generated from entity target.\n * Note that table name comes here already normalized by #tableName method.\n */\n prefixTableName(prefix: string, tableName: string): string\n\n /**\n * Gets the name of the alias used for relation joins.\n */\n eagerJoinRelationAlias(alias: string, propertyPath: string): string\n\n /**\n * Column names for nested sets.\n */\n nestedSetColumnNames: { left: string; right: string }\n\n /**\n * Column name for materialized paths.\n */\n materializedPathColumnName: string\n}\n"],"sourceRoot":".."}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "name": "typeorm", "private": false, "version": "0.3.11-dev.
|
|
1
|
+
{ "name": "typeorm", "private": false, "version": "0.3.11-dev.1cb738a", "description": "Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.", "license": "MIT", "readmeFilename": "README.md", "author": { "name": "Umed Khudoiberdiev", "email": "pleerock.me@gmail.com" }, "engines": { "node": ">= 12.9.0" }, "exports": { ".": { "types": "./index.d.ts", "node": { "import": "./index.mjs", "require": "./index.js", "types": "./index.d.ts" }, "browser": { "require": "./index.js", "import": "./browser/index.js", "default": "./index.js" } }, "./browser": { "types": "./index.d.ts", "default": "./browser/index.js" }, "./*.js": "./*.js", "./*": { "require": "./*.js", "import": "./*" } }, "main": "./index.js", "module": "./index.mjs", "types": "./index.d.ts", "browser": { "./browser/connection/ConnectionOptionsReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsXmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsYmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/driver/aurora-data-api/AuroraDataApiDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/better-sqlite3/BetterSqlite3Driver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/cockroachdb/CockroachDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoQueryRunner.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mysql/MysqlDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/oracle/OracleDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/postgres/PostgresDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sap/SapDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlite/SqliteDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlserver/SqlServerDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/entity-manager/MongoEntityManager.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/logger/FileLogger.js": "./browser/platform/BrowserFileLoggerDummy.js", "./browser/platform/PlatformTools.js": "./browser/platform/BrowserPlatformTools.js", "./browser/repository/MongoRepository.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/util/DirectoryExportedClassesLoader.js": "./browser/platform/BrowserDirectoryExportedClassesLoader.js", "./index.js": "./browser/index.js", "./index.mjs": "./browser/index.js" }, "repository": { "type": "git", "url": "https://github.com/typeorm/typeorm.git" }, "bugs": { "url": "https://github.com/typeorm/typeorm/issues" }, "homepage": "https://typeorm.io", "tags": [ "orm", "typescript", "typescript-orm", "mysql", "mysql-orm", "postgresql", "postgresql-orm", "mariadb", "mariadb-orm", "spanner", "sqlite", "sqlite-orm", "sql-server", "sql-server-orm", "oracle", "oracle-orm", "cloud-spanner", "cloud-spanner-orm" ], "devDependencies": { "@types/app-root-path": "^1.2.4", "@types/chai": "^4.2.15", "@types/chai-as-promised": "^7.1.3", "@types/debug": "^4.1.5", "@types/js-yaml": "^4.0.0", "@types/mkdirp": "^1.0.1", "@types/mocha": "^8.2.1", "@types/node": "^14.14.31", "@types/rimraf": "^3.0.0", "@types/sha.js": "^2.4.0", "@types/sinon": "^9.0.10", "@types/source-map-support": "^0.5.3", "@types/uuid": "^8.3.4", "@types/xml2js": "^0.4.8", "@types/yargs": "^17.0.2", "better-sqlite3": "^8.0.0", "chai": "^4.3.0", "chai-as-promised": "^7.1.1", "class-transformer": "^0.4.0", "conventional-changelog-angular": "^5.0.12", "conventional-changelog-cli": "^2.1.1", "del": "^6.0.0", "gulp": "^4.0.2", "gulp-istanbul": "^1.1.3", "gulp-mocha": "^8.0.0", "gulp-rename": "^2.0.0", "gulp-replace": "^1.0.0", "gulp-shell": "^0.8.0", "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^6.0.0-alpha.1", "gulpclass": "^0.2.0", "husky": "^5.1.1", "mocha": "^8.3.0", "mongodb": "^3.6.4", "mssql": "^7.3.0", "mysql": "^2.18.1", "mysql2": "^2.2.5", "pg": "^8.5.1", "pg-query-stream": "^4.0.0", "prettier": "^2.5.1", "redis": "^3.1.1", "remap-istanbul": "^0.13.0", "rimraf": "^3.0.2", "sinon": "^9.2.4", "sinon-chai": "^3.5.0", "source-map-support": "^0.5.19", "sql.js": "^1.4.0", "sqlite3": "^5.0.11", "ts-node": "^10.7.0", "typeorm-aurora-data-api-driver": "^2.0.0", "typescript": "^4.8.2" }, "peerDependencies": { "@google-cloud/spanner": "^5.18.0", "@sap/hana-client": "^2.12.25", "better-sqlite3": "^7.1.2 || ^8.0.0", "hdb-pool": "^0.1.6", "ioredis": "^5.0.4", "mongodb": "^3.6.0", "mssql": "^7.3.0", "mysql2": "^2.2.5", "oracledb": "^5.1.0", "pg": "^8.5.1", "pg-native": "^3.0.0", "pg-query-stream": "^4.0.0", "redis": "^3.1.1 || ^4.0.0", "sql.js": "^1.4.0", "sqlite3": "^5.0.3", "ts-node": "^10.7.0", "typeorm-aurora-data-api-driver": "^2.0.0" }, "peerDependenciesMeta": { "@google-cloud/spanner": { "optional": true }, "@sap/hana-client": { "optional": true }, "better-sqlite3": { "optional": true }, "hdb-pool": { "optional": true }, "ioredis": { "optional": true }, "mongodb": { "optional": true }, "mssql": { "optional": true }, "mysql2": { "optional": true }, "oracledb": { "optional": true }, "pg": { "optional": true }, "pg-native": { "optional": true }, "pg-query-stream": { "optional": true }, "redis": { "optional": true }, "sql.js": { "optional": true }, "sqlite3": { "optional": true }, "ts-node": { "optional": true }, "typeorm-aurora-data-api-driver": { "optional": true } }, "dependencies": { "@sqltools/formatter": "^1.2.2", "app-root-path": "^3.0.0", "buffer": "^6.0.3", "chalk": "^4.1.0", "cli-highlight": "^2.1.11", "date-fns": "^2.28.0", "debug": "^4.3.3", "dotenv": "^16.0.0", "glob": "^7.2.0", "js-yaml": "^4.1.0", "mkdirp": "^1.0.4", "reflect-metadata": "^0.1.13", "sha.js": "^2.4.11", "tslib": "^2.3.1", "uuid": "^8.3.2", "xml2js": "^0.4.23", "yargs": "^17.3.1" }, "scripts": { "test": "rimraf ./build && tsc && mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 60000 ./build/compiled/test", "test-fast": "mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 60000 ./build/compiled/test", "compile": "rimraf ./build && tsc", "watch": "./node_modules/.bin/tsc -w", "package": "gulp package", "pack": "gulp pack", "lint": "prettier --check \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"", "format": "prettier --write \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2" }, "bin": { "typeorm": "./cli.js", "typeorm-ts-node-commonjs": "./cli-ts-node-commonjs.js", "typeorm-ts-node-esm": "./cli-ts-node-esm.js" }, "funding": "https://opencollective.com/typeorm", "collective": { "type": "opencollective", "url": "https://opencollective.com/typeorm", "logo": "https://opencollective.com/opencollective/logo.txt" }, "nyc": { "all": true, "cache": false, "exclude": [ "**/*.d.ts" ], "extension": [ ".ts" ], "include": [ "build/compiled/src/**", "src/**" ], "reporter": "json" } }
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MaterializedPathSubjectExecutor = void 0;
|
|
4
4
|
const OrmUtils_1 = require("../../util/OrmUtils");
|
|
5
|
+
const EntityMetadata_1 = require("../../metadata/EntityMetadata");
|
|
6
|
+
const Brackets_1 = require("../../query-builder/Brackets");
|
|
5
7
|
/**
|
|
6
8
|
* Executes subject operations for materialized-path tree entities.
|
|
7
9
|
*/
|
|
@@ -61,8 +63,8 @@ class MaterializedPathSubjectExecutor {
|
|
|
61
63
|
return Object.entries(subject.identifier).every(([key, value]) => child[key] === value);
|
|
62
64
|
});
|
|
63
65
|
const oldParent = subject.metadata.treeParentRelation.getEntityValue(entity);
|
|
64
|
-
const oldParentId =
|
|
65
|
-
const newParentId =
|
|
66
|
+
const oldParentId = this.getEntityParentReferencedColumnMap(subject, oldParent);
|
|
67
|
+
const newParentId = this.getEntityParentReferencedColumnMap(subject, newParent);
|
|
66
68
|
// Exit if the new and old parents are the same
|
|
67
69
|
if (OrmUtils_1.OrmUtils.compareIds(oldParentId, newParentId)) {
|
|
68
70
|
return;
|
|
@@ -86,21 +88,34 @@ class MaterializedPathSubjectExecutor {
|
|
|
86
88
|
.createQueryBuilder()
|
|
87
89
|
.update(subject.metadata.target)
|
|
88
90
|
.set({
|
|
89
|
-
[propertyPath]: () => `REPLACE(${propertyPath}, '${oldParentPath}${entityPath}.', '${newParentPath}${entityPath}.')`,
|
|
91
|
+
[propertyPath]: () => `REPLACE(${this.queryRunner.connection.driver.escape(propertyPath)}, '${oldParentPath}${entityPath}.', '${newParentPath}${entityPath}.')`,
|
|
90
92
|
})
|
|
91
93
|
.where(`${propertyPath} LIKE :path`, {
|
|
92
94
|
path: `${oldParentPath}${entityPath}.%`,
|
|
93
95
|
})
|
|
94
96
|
.execute();
|
|
95
97
|
}
|
|
98
|
+
getEntityParentReferencedColumnMap(subject, entity) {
|
|
99
|
+
if (!entity)
|
|
100
|
+
return undefined;
|
|
101
|
+
return EntityMetadata_1.EntityMetadata.getValueMap(entity, subject.metadata
|
|
102
|
+
.treeParentRelation.joinColumns.map((column) => column.referencedColumn)
|
|
103
|
+
.filter((v) => v != null), { skipNulls: true });
|
|
104
|
+
}
|
|
96
105
|
getEntityPath(subject, id) {
|
|
106
|
+
const metadata = subject.metadata;
|
|
107
|
+
const normalized = (Array.isArray(id) ? id : [id]).map((id) => metadata.ensureEntityIdMap(id));
|
|
97
108
|
return this.queryRunner.manager
|
|
98
109
|
.createQueryBuilder()
|
|
99
110
|
.select(subject.metadata.targetName +
|
|
100
111
|
"." +
|
|
101
112
|
subject.metadata.materializedPathColumn.propertyPath, "path")
|
|
102
113
|
.from(subject.metadata.target, subject.metadata.targetName)
|
|
103
|
-
.
|
|
114
|
+
.where(new Brackets_1.Brackets((qb) => {
|
|
115
|
+
for (const data of normalized) {
|
|
116
|
+
qb.orWhere(new Brackets_1.Brackets((qb) => qb.where(data)));
|
|
117
|
+
}
|
|
118
|
+
}))
|
|
104
119
|
.getRawOne()
|
|
105
120
|
.then((result) => (result ? result["path"] : ""));
|
|
106
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/persistence/tree/MaterializedPathSubjectExecutor.ts"],"names":[],"mappings":";;;AAEA,kDAA8C;AAG9C;;GAEG;AACH,MAAa,+BAA+B;IACxC,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,YAAsB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAElD,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,OAAgB;QACzB,IAAI,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,kBAAmB,CAAC,cAAc,CAC5D,OAAO,CAAC,MAAO,CAClB,CAAA,CAAC,oCAAoC;QACtC,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM;YAChE,sCAAsC;YACtC,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,gBAAgB;gBAC3C,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,gBAAgB;gBACxC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAA;QAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAExD,IAAI,UAAU,GAAW,EAAE,CAAA;QAC3B,IAAI,QAAQ,EAAE;YACV,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;SAC3D;QAED,MAAM,gBAAgB,GAAG,OAAO,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,EAAE,CACjB,WAAW,YAAY,MAAM,aAAa,GAAG,UAAU,QAAQ,aAAa,GAAG,UAAU,KAAK;SAC9F,CAAC;aACR,KAAK,CAAC,GAAG,YAAY,aAAa,EAAE;YACjC,IAAI,EAAE,GAAG,aAAa,GAAG,UAAU,IAAI;SAC1C,CAAC;aACD,OAAO,EAAE,CAAA;IAClB,CAAC;IAEO,aAAa,CACjB,OAAgB,EAChB,EAAiB;QAEjB,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO;aAC1B,kBAAkB,EAAE;aACpB,MAAM,CACH,OAAO,CAAC,QAAQ,CAAC,UAAU;YACvB,GAAG;YACH,OAAO,CAAC,QAAQ,CAAC,sBAAuB,CAAC,YAAY,EACzD,MAAM,CACT;aACA,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;aAC1D,UAAU,CAAC,EAAE,CAAC;aACd,SAAS,EAAE;aACX,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACzD,CAAC;CACJ;AApID,0EAoIC","file":"MaterializedPathSubjectExecutor.js","sourcesContent":["import { Subject } from \"../Subject\"\nimport { QueryRunner } from \"../../query-runner/QueryRunner\"\nimport { OrmUtils } from \"../../util/OrmUtils\"\nimport { ObjectLiteral } from \"../../common/ObjectLiteral\"\n\n/**\n * Executes subject operations for materialized-path tree entities.\n */\nexport class MaterializedPathSubjectExecutor {\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(protected queryRunner: QueryRunner) {}\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Executes operations when subject is being inserted.\n */\n async insert(subject: Subject): Promise<void> {\n let parent = subject.metadata.treeParentRelation!.getEntityValue(\n subject.entity!,\n ) // if entity was attached via parent\n if (!parent && subject.parentSubject && subject.parentSubject.entity)\n // if entity was attached via children\n parent = subject.parentSubject.insertedValueSet\n ? subject.parentSubject.insertedValueSet\n : subject.parentSubject.entity\n\n const parentId = subject.metadata.getEntityIdMap(parent)\n\n let parentPath: string = \"\"\n if (parentId) {\n parentPath = await this.getEntityPath(subject, parentId)\n }\n\n const insertedEntityId = subject.metadata\n .treeParentRelation!.joinColumns.map((joinColumn) => {\n return joinColumn.referencedColumn!.getEntityValue(\n subject.insertedValueSet!,\n )\n })\n .join(\"_\")\n\n await this.queryRunner.manager\n .createQueryBuilder()\n .update(subject.metadata.target)\n .set({\n [subject.metadata.materializedPathColumn!.propertyPath]:\n parentPath + insertedEntityId + \".\",\n } as any)\n .where(subject.identifier!)\n .execute()\n }\n\n /**\n * Executes operations when subject is being updated.\n */\n async update(subject: Subject): Promise<void> {\n let newParent = subject.metadata.treeParentRelation!.getEntityValue(\n subject.entity!,\n ) // if entity was attached via parent\n if (!newParent && subject.parentSubject && subject.parentSubject.entity)\n // if entity was attached via children\n newParent = subject.parentSubject.entity\n\n let entity = subject.databaseEntity // if entity was attached via parent\n if (!entity && newParent)\n // if entity was attached via children\n entity = subject.metadata\n .treeChildrenRelation!.getEntityValue(newParent)\n .find((child: any) => {\n return Object.entries(subject.identifier!).every(\n ([key, value]) => child[key] === value,\n )\n })\n\n const oldParent = subject.metadata.treeParentRelation!.getEntityValue(\n entity!,\n )\n const oldParentId = subject.metadata.getEntityIdMap(oldParent)\n const newParentId = subject.metadata.getEntityIdMap(newParent)\n\n // Exit if the new and old parents are the same\n if (OrmUtils.compareIds(oldParentId, newParentId)) {\n return\n }\n\n let newParentPath: string = \"\"\n if (newParentId) {\n newParentPath = await this.getEntityPath(subject, newParentId)\n }\n\n let oldParentPath: string = \"\"\n if (oldParentId) {\n oldParentPath =\n (await this.getEntityPath(subject, oldParentId)) || \"\"\n }\n\n const entityPath = subject.metadata\n .treeParentRelation!.joinColumns.map((joinColumn) => {\n return joinColumn.referencedColumn!.getEntityValue(entity!)\n })\n .join(\"_\")\n\n const propertyPath =\n subject.metadata.materializedPathColumn!.propertyPath\n await this.queryRunner.manager\n .createQueryBuilder()\n .update(subject.metadata.target)\n .set({\n [propertyPath]: () =>\n `REPLACE(${propertyPath}, '${oldParentPath}${entityPath}.', '${newParentPath}${entityPath}.')`,\n } as any)\n .where(`${propertyPath} LIKE :path`, {\n path: `${oldParentPath}${entityPath}.%`,\n })\n .execute()\n }\n\n private getEntityPath(\n subject: Subject,\n id: ObjectLiteral,\n ): Promise<string> {\n return this.queryRunner.manager\n .createQueryBuilder()\n .select(\n subject.metadata.targetName +\n \".\" +\n subject.metadata.materializedPathColumn!.propertyPath,\n \"path\",\n )\n .from(subject.metadata.target, subject.metadata.targetName)\n .whereInIds(id)\n .getRawOne()\n .then((result) => (result ? result[\"path\"] : \"\"))\n }\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../../src/persistence/tree/MaterializedPathSubjectExecutor.ts"],"names":[],"mappings":";;;AAEA,kDAA8C;AAG9C,kEAA8D;AAC9D,2DAAuD;AAEvD;;GAEG;AACH,MAAa,+BAA+B;IACxC,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,YAAsB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAElD,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,OAAgB;QACzB,IAAI,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,kBAAmB,CAAC,cAAc,CAC5D,OAAO,CAAC,MAAO,CAClB,CAAA,CAAC,oCAAoC;QACtC,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM;YAChE,sCAAsC;YACtC,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,gBAAgB;gBAC3C,CAAC,CAAC,OAAO,CAAC,aAAa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AC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAC1D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,CACjC,CAAA;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO;aAC1B,kBAAkB,EAAE;aACpB,MAAM,CACH,OAAO,CAAC,QAAQ,CAAC,UAAU;YACvB,GAAG;YACH,OAAO,CAAC,QAAQ,CAAC,sBAAuB,CAAC,YAAY,EACzD,MAAM,CACT;aACA,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;aAC1D,KAAK,CACF,IAAI,mBAAQ,CAAC,CAAC,EAAE,EAAE,EAAE;YAChB,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE;gBAC3B,EAAE,CAAC,OAAO,CAAC,IAAI,mBAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;aACnD;QACL,CAAC,CAAC,CACL;aACA,SAAS,EAAE;aACX,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACzD,CAAC;CACJ;AAtKD,0EAsKC","file":"MaterializedPathSubjectExecutor.js","sourcesContent":["import { Subject } from \"../Subject\"\nimport { QueryRunner } from \"../../query-runner/QueryRunner\"\nimport { OrmUtils } from \"../../util/OrmUtils\"\nimport { ObjectLiteral } from \"../../common/ObjectLiteral\"\nimport { ColumnMetadata } from \"../../metadata/ColumnMetadata\"\nimport { EntityMetadata } from \"../../metadata/EntityMetadata\"\nimport { Brackets } from \"../../query-builder/Brackets\"\n\n/**\n * Executes subject operations for materialized-path tree entities.\n */\nexport class MaterializedPathSubjectExecutor {\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(protected queryRunner: QueryRunner) {}\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Executes operations when subject is being inserted.\n */\n async insert(subject: Subject): Promise<void> {\n let parent = subject.metadata.treeParentRelation!.getEntityValue(\n subject.entity!,\n ) // if entity was attached via parent\n if (!parent && subject.parentSubject && subject.parentSubject.entity)\n // if entity was attached via children\n parent = subject.parentSubject.insertedValueSet\n ? subject.parentSubject.insertedValueSet\n : subject.parentSubject.entity\n\n const parentId = subject.metadata.getEntityIdMap(parent)\n\n let parentPath: string = \"\"\n if (parentId) {\n parentPath = await this.getEntityPath(subject, parentId)\n }\n\n const insertedEntityId = subject.metadata\n .treeParentRelation!.joinColumns.map((joinColumn) => {\n return joinColumn.referencedColumn!.getEntityValue(\n subject.insertedValueSet!,\n )\n })\n .join(\"_\")\n\n await this.queryRunner.manager\n .createQueryBuilder()\n .update(subject.metadata.target)\n .set({\n [subject.metadata.materializedPathColumn!.propertyPath]:\n parentPath + insertedEntityId + \".\",\n } as any)\n .where(subject.identifier!)\n .execute()\n }\n\n /**\n * Executes operations when subject is being updated.\n */\n async update(subject: Subject): Promise<void> {\n let newParent = subject.metadata.treeParentRelation!.getEntityValue(\n subject.entity!,\n ) // if entity was attached via parent\n if (!newParent && subject.parentSubject && subject.parentSubject.entity)\n // if entity was attached via children\n newParent = subject.parentSubject.entity\n\n let entity = subject.databaseEntity // if entity was attached via parent\n if (!entity && newParent)\n // if entity was attached via children\n entity = subject.metadata\n .treeChildrenRelation!.getEntityValue(newParent)\n .find((child: any) => {\n return Object.entries(subject.identifier!).every(\n ([key, value]) => child[key] === value,\n )\n })\n\n const oldParent = subject.metadata.treeParentRelation!.getEntityValue(\n entity!,\n )\n const oldParentId = this.getEntityParentReferencedColumnMap(\n subject,\n oldParent,\n )\n const newParentId = this.getEntityParentReferencedColumnMap(\n subject,\n newParent,\n )\n\n // Exit if the new and old parents are the same\n if (OrmUtils.compareIds(oldParentId, newParentId)) {\n return\n }\n\n let newParentPath: string = \"\"\n if (newParentId) {\n newParentPath = await this.getEntityPath(subject, newParentId)\n }\n\n let oldParentPath: string = \"\"\n if (oldParentId) {\n oldParentPath =\n (await this.getEntityPath(subject, oldParentId)) || \"\"\n }\n\n const entityPath = subject.metadata\n .treeParentRelation!.joinColumns.map((joinColumn) => {\n return joinColumn.referencedColumn!.getEntityValue(entity!)\n })\n .join(\"_\")\n\n const propertyPath =\n subject.metadata.materializedPathColumn!.propertyPath\n await this.queryRunner.manager\n .createQueryBuilder()\n .update(subject.metadata.target)\n .set({\n [propertyPath]: () =>\n `REPLACE(${this.queryRunner.connection.driver.escape(\n propertyPath,\n )}, '${oldParentPath}${entityPath}.', '${newParentPath}${entityPath}.')`,\n } as any)\n .where(`${propertyPath} LIKE :path`, {\n path: `${oldParentPath}${entityPath}.%`,\n })\n .execute()\n }\n\n private getEntityParentReferencedColumnMap(\n subject: Subject,\n entity: ObjectLiteral | undefined,\n ): ObjectLiteral | undefined {\n if (!entity) return undefined\n return EntityMetadata.getValueMap(\n entity,\n subject.metadata\n .treeParentRelation!.joinColumns.map(\n (column) => column.referencedColumn,\n )\n .filter((v) => v != null) as ColumnMetadata[],\n { skipNulls: true },\n )\n }\n\n private getEntityPath(\n subject: Subject,\n id: ObjectLiteral,\n ): Promise<string> {\n const metadata = subject.metadata\n const normalized = (Array.isArray(id) ? id : [id]).map((id) =>\n metadata.ensureEntityIdMap(id),\n )\n return this.queryRunner.manager\n .createQueryBuilder()\n .select(\n subject.metadata.targetName +\n \".\" +\n subject.metadata.materializedPathColumn!.propertyPath,\n \"path\",\n )\n .from(subject.metadata.target, subject.metadata.targetName)\n .where(\n new Brackets((qb) => {\n for (const data of normalized) {\n qb.orWhere(new Brackets((qb) => qb.where(data)))\n }\n }),\n )\n .getRawOne()\n .then((result) => (result ? result[\"path\"] : \"\"))\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -705,6 +705,8 @@ class QueryBuilder {
|
|
|
705
705
|
return `NOT(${this.createWhereConditionExpression(condition.condition)})`;
|
|
706
706
|
case "brackets":
|
|
707
707
|
return `${this.createWhereConditionExpression(condition.condition, true)}`;
|
|
708
|
+
case "and":
|
|
709
|
+
return condition.parameters.join(" AND ");
|
|
708
710
|
}
|
|
709
711
|
throw new TypeError(`Unsupported FindOperator ${FindOperator_1.FindOperator.constructor.name}`);
|
|
710
712
|
}
|
|
@@ -973,6 +975,13 @@ class QueryBuilder {
|
|
|
973
975
|
};
|
|
974
976
|
}
|
|
975
977
|
}
|
|
978
|
+
else if (parameterValue.type === "and") {
|
|
979
|
+
const values = parameterValue.value;
|
|
980
|
+
return {
|
|
981
|
+
operator: parameterValue.type,
|
|
982
|
+
parameters: values.map((operator) => this.createWhereConditionExpression(this.getWherePredicateCondition(aliasPath, operator))),
|
|
983
|
+
};
|
|
984
|
+
}
|
|
976
985
|
else {
|
|
977
986
|
return {
|
|
978
987
|
operator: parameterValue.type,
|