├── .editorconfig ├── .github ├── FUNDING.yml └── workflows │ └── ci.yml ├── .gitignore ├── .vscode └── settings.json ├── CHANGELOG.md ├── CONTRIBUTING.md ├── DEVELOPER.md ├── ISSUE_TEMPLATE.md ├── LICENSE ├── README-zh_CN.md ├── README.md ├── cli.ts ├── codecov.yml ├── dem.json ├── docker-compose.yml ├── docker └── hana │ └── hxe-config.json ├── docs ├── active-record-data-mapper.md ├── caching.md ├── connection-api.md ├── connection-options.md ├── connection.md ├── custom-repository.md ├── decorator-reference.md ├── delete-query-builder.md ├── eager-and-lazy-relations.md ├── embedded-entities.md ├── entities.md ├── entity-inheritance.md ├── entity-manager-api.md ├── entity-metadata.md ├── example-with-express.md ├── faq.md ├── find-options.md ├── index.md ├── indices.md ├── insert-query-builder.md ├── internals.md ├── listeners-and-subscribers.md ├── logging.md ├── many-to-many-relations.md ├── many-to-one-one-to-many-relations.md ├── migrations.md ├── mongodb.md ├── multiple-connections.md ├── naming-strategy.md ├── one-to-one-relations.md ├── query-runner.md ├── relational-query-builder.md ├── relations-faq.md ├── relations.md ├── repository-api.md ├── roadmap.md ├── select-query-builder.md ├── separating-entity-definition.md ├── sequelize-migration.md ├── support.md ├── supported-platforms.md ├── transactions.md ├── tree-entities.md ├── troubleshooting.md ├── update-query-builder.md ├── usage-with-javascript.md ├── using-cli.md ├── using-ormconfig.md ├── validation.md ├── view-entities.md ├── working-with-entity-manager.md ├── working-with-repository.md └── zh_CN │ ├── README.md │ ├── active-record-data-mapper.md │ ├── caching.md │ ├── changelog.md │ ├── connection-api.md │ ├── connection-options.md │ ├── connection.md │ ├── custom-repository.md │ ├── decorator-reference.md │ ├── delete-query-builder.md │ ├── eager-and-lazy-relations.md │ ├── embedded-entities.md │ ├── entities.md │ ├── entity-inheritance.md │ ├── entity-manager-api.md │ ├── entity-metadata.md │ ├── example-with-express.md │ ├── faq.md │ ├── find-options.md │ ├── index.md │ ├── indices.md │ ├── insert-query-builder.md │ ├── internals.md │ ├── listeners-and-subscribers.md │ ├── logging.md │ ├── many-to-many-relations.md │ ├── many-to-one-one-to-many-relations.md │ ├── migrations.md │ ├── mongodb.md │ ├── multiple-connections.md │ ├── naming-strategy.md │ ├── one-to-one-relations.md │ ├── query-runner.md │ ├── relational-query-builder.md │ ├── relations-faq.md │ ├── relations.md │ ├── repository-api.md │ ├── roadmap.md │ ├── select-query-builder.md │ ├── separating-entity-definition.md │ ├── sequelize-migration.md │ ├── support.md │ ├── supported-platforms.md │ ├── transactions.md │ ├── tree-entities.md │ ├── troubleshooting.md │ ├── update-query-builder.md │ ├── usage-with-javascript.md │ ├── using-cli.md │ ├── using-ormconfig.md │ ├── validation.md │ ├── view-entities.md │ ├── working-with-entity-manager.md │ └── working-with-repository.md ├── extra ├── typeorm-class-transformer-shim.js └── typeorm-model-shim.js ├── gulpfile.ts ├── mod.ts ├── ormconfig.gh-actions.json ├── ormconfig.json.dist ├── package-lock.json ├── package.json ├── resources └── logo_big.png ├── sample ├── sample1-simple-entity │ ├── app.ts │ └── entity │ │ └── Post.ts ├── sample10-mixed │ ├── app.ts │ └── entity │ │ ├── Category.ts │ │ ├── Chapter.ts │ │ ├── Cover.ts │ │ ├── Image.ts │ │ ├── ImageDetails.ts │ │ ├── Post.ts │ │ └── PostDetails.ts ├── sample11-all-types-entity │ ├── app.ts │ └── entity │ │ └── EverythingEntity.ts ├── sample12-custom-naming-strategy │ ├── app.ts │ ├── entity │ │ └── Post.ts │ └── naming-strategy │ │ └── CustomNamingStrategy.ts ├── sample13-everywhere-abstraction │ ├── app.ts │ └── entity │ │ ├── BaseObject.ts │ │ ├── BasePost.ts │ │ ├── Blog.ts │ │ ├── Post.ts │ │ ├── PostAuthor.ts │ │ ├── PostCategory.ts │ │ └── PostUser.ts ├── sample14-errors-in-wrong-metdata │ ├── app.ts │ └── entity │ │ ├── Post.ts │ │ └── PostAuthor.ts ├── sample16-indexes │ ├── app.ts │ └── entity │ │ ├── BasePost.ts │ │ └── Post.ts ├── sample17-versioning │ ├── app.ts │ └── entity │ │ └── Post.ts ├── sample18-lazy-relations │ ├── app.ts │ └── entity │ │ ├── Author.ts │ │ ├── Category.ts │ │ └── Post.ts ├── sample19-one-side-relations │ ├── app.ts │ └── entity │ │ ├── Author.ts │ │ ├── Category.ts │ │ ├── Post.ts │ │ └── PostMetadata.ts ├── sample2-one-to-one │ ├── app.ts │ └── entity │ │ ├── Post.ts │ │ ├── PostAuthor.ts │ │ ├── PostCategory.ts │ │ ├── PostDetails.ts │ │ ├── PostImage.ts │ │ ├── PostInformation.ts │ │ └── PostMetadata.ts ├── sample20-join-without-relation │ ├── app.ts │ └── entity │ │ ├── Author.ts │ │ ├── Category.ts │ │ └── Post.ts ├── sample21-custom-join-table-column │ ├── app.ts │ └── entity │ │ ├── Author.ts │ │ ├── Category.ts │ │ └── Post.ts ├── sample22-closure-table │ ├── app.ts │ └── entity │ │ └── Category.ts ├── sample23-nested-joins │ ├── app.ts │ └── entity │ │ ├── Author.ts │ │ ├── Category.ts │ │ └── Post.ts ├── sample24-schemas │ ├── app.ts │ ├── entity │ │ ├── Category.ts │ │ ├── Image.ts │ │ ├── Post.ts │ │ └── PostDetails.ts │ └── schemas │ │ ├── category.json │ │ ├── image.json │ │ ├── post-details.json │ │ └── post.json ├── sample25-insert-from-inverse-side │ ├── app.ts │ └── entity │ │ ├── Author.ts │ │ └── Post.ts ├── sample26-embedded-tables │ ├── app.ts │ └── entity │ │ ├── Counters.ts │ │ ├── Post.ts │ │ └── Question.ts ├── sample27-composite-primary-keys │ ├── app.ts │ └── entity │ │ └── Post.ts ├── sample28-single-table-inheritance │ ├── app.ts │ └── entity │ │ ├── Employee.ts │ │ ├── Homesitter.ts │ │ ├── Person.ts │ │ └── Student.ts ├── sample3-many-to-one │ ├── app.ts │ └── entity │ │ ├── Post.ts │ │ ├── PostAuthor.ts │ │ ├── PostCategory.ts │ │ ├── PostDetails.ts │ │ ├── PostImage.ts │ │ ├── PostInformation.ts │ │ └── PostMetadata.ts ├── sample30-default-order-by │ ├── app.ts │ └── entity │ │ ├── Category.ts │ │ └── Post.ts ├── sample31-table-prefix │ ├── app.ts │ └── entity │ │ ├── Author.ts │ │ ├── Category.ts │ │ └── Post.ts ├── sample32-migrations │ ├── app.ts │ ├── entity │ │ ├── Author.ts │ │ └── Post.ts │ └── migrations │ │ ├── 1481283582-first-release-changes.ts │ │ └── 1481521933-second-release-changes.ts ├── sample33-custom-repository │ ├── app.ts │ ├── entity │ │ ├── Author.ts │ │ ├── Post.ts │ │ └── User.ts │ └── repository │ │ ├── AuthorRepository.ts │ │ ├── PostRepository.ts │ │ └── UserRepository.ts ├── sample34-mongodb │ ├── app.ts │ └── entity │ │ └── Post.ts ├── sample4-many-to-many │ ├── app.ts │ └── entity │ │ ├── Post.ts │ │ ├── PostAuthor.ts │ │ ├── PostCategory.ts │ │ ├── PostDetails.ts │ │ ├── PostImage.ts │ │ ├── PostInformation.ts │ │ └── PostMetadata.ts ├── sample5-subscribers │ ├── app.ts │ ├── entity │ │ ├── Post.ts │ │ ├── PostAuthor.ts │ │ └── PostCategory.ts │ └── subscriber │ │ └── EverythingSubscriber.ts ├── sample6-abstract-table │ ├── app.ts │ └── entity │ │ ├── BasePost.ts │ │ ├── Blog.ts │ │ ├── Post.ts │ │ ├── PostAuthor.ts │ │ └── PostCategory.ts ├── sample7-pagination │ ├── app.ts │ └── entity │ │ ├── Post.ts │ │ ├── PostAuthor.ts │ │ └── PostCategory.ts ├── sample8-self-referencing │ ├── app.ts │ └── entity │ │ └── Category.ts └── sample9-entity-listeners │ ├── app.ts │ └── entity │ ├── Post.ts │ ├── PostAuthor.ts │ └── PostCategory.ts ├── src ├── cache │ ├── DbQueryResultCache.ts │ ├── QueryResultCache.ts │ ├── QueryResultCacheFactory.ts │ ├── QueryResultCacheOptions.ts │ └── RedisQueryResultCache.ts ├── cli.ts ├── commands │ ├── CacheClearCommand.ts │ ├── CommandUtils.ts │ ├── EntityCreateCommand.ts │ ├── InitCommand.ts │ ├── MigrationCreateCommand.ts │ ├── MigrationGenerateCommand.ts │ ├── MigrationRevertCommand.ts │ ├── MigrationRunCommand.ts │ ├── MigrationShowCommand.ts │ ├── QueryCommand.ts │ ├── SchemaDropCommand.ts │ ├── SchemaLogCommand.ts │ ├── SchemaSyncCommand.ts │ ├── SubscriberCreateCommand.ts │ ├── VersionCommand.ts │ └── types.ts ├── common │ ├── DeepPartial.ts │ ├── ObjectLiteral.ts │ └── ObjectType.ts ├── connection │ ├── BaseConnectionOptions.ts │ ├── Connection.ts │ ├── ConnectionManager.ts │ ├── ConnectionMetadataBuilder.ts │ ├── ConnectionOptions.ts │ ├── ConnectionOptionsReader.ts │ ├── options-reader │ │ ├── ConnectionOptionsEnvReader.ts │ │ ├── ConnectionOptionsXmlReader.ts │ │ └── ConnectionOptionsYmlReader.ts │ └── typings.ts ├── container.ts ├── decorator │ ├── Check.ts │ ├── EntityRepository.ts │ ├── Exclusion.ts │ ├── Generated.ts │ ├── Index.ts │ ├── Unique.ts │ ├── columns │ │ ├── Column.ts │ │ ├── CreateDateColumn.ts │ │ ├── ObjectIdColumn.ts │ │ ├── PrimaryColumn.ts │ │ ├── PrimaryGeneratedColumn.ts │ │ ├── UpdateDateColumn.ts │ │ ├── VersionColumn.ts │ │ └── ViewColumn.ts │ ├── entity-view │ │ └── ViewEntity.ts │ ├── entity │ │ ├── ChildEntity.ts │ │ ├── Entity.ts │ │ └── TableInheritance.ts │ ├── listeners │ │ ├── AfterInsert.ts │ │ ├── AfterLoad.ts │ │ ├── AfterRemove.ts │ │ ├── AfterUpdate.ts │ │ ├── BeforeInsert.ts │ │ ├── BeforeRemove.ts │ │ ├── BeforeUpdate.ts │ │ └── EventSubscriber.ts │ ├── options │ │ ├── ColumnCommonOptions.ts │ │ ├── ColumnEmbeddedOptions.ts │ │ ├── ColumnEnumOptions.ts │ │ ├── ColumnHstoreOptions.ts │ │ ├── ColumnNumericOptions.ts │ │ ├── ColumnOptions.ts │ │ ├── ColumnWithLengthOptions.ts │ │ ├── ColumnWithWidthOptions.ts │ │ ├── EntityOptions.ts │ │ ├── IndexOptions.ts │ │ ├── JoinColumnOptions.ts │ │ ├── JoinTableMultipleColumnsOptions.ts │ │ ├── JoinTableOptions.ts │ │ ├── PrimaryGeneratedColumnNumericOptions.ts │ │ ├── PrimaryGeneratedColumnUUIDOptions.ts │ │ ├── RelationOptions.ts │ │ ├── SpatialColumnOptions.ts │ │ ├── TransactionOptions.ts │ │ ├── ValueTransformer.ts │ │ └── ViewEntityOptions.ts │ ├── relations │ │ ├── JoinColumn.ts │ │ ├── JoinTable.ts │ │ ├── ManyToMany.ts │ │ ├── ManyToOne.ts │ │ ├── OneToMany.ts │ │ ├── OneToOne.ts │ │ ├── RelationCount.ts │ │ └── RelationId.ts │ ├── transaction │ │ ├── Transaction.ts │ │ ├── TransactionManager.ts │ │ └── TransactionRepository.ts │ └── tree │ │ ├── Tree.ts │ │ ├── TreeChildren.ts │ │ ├── TreeLevelColumn.ts │ │ └── TreeParent.ts ├── driver │ ├── Driver.ts │ ├── DriverFactory.ts │ ├── DriverUtils.ts │ ├── Query.ts │ ├── SqlInMemory.ts │ ├── aurora-data-api │ │ ├── AuroraDataApiConnection.ts │ │ ├── AuroraDataApiConnectionCredentialsOptions.ts │ │ ├── AuroraDataApiConnectionOptions.ts │ │ ├── AuroraDataApiDriver.ts │ │ └── AuroraDataApiQueryRunner.ts │ ├── cockroachdb │ │ ├── CockroachConnectionCredentialsOptions.ts │ │ ├── CockroachConnectionOptions.ts │ │ ├── CockroachDriver.ts │ │ └── CockroachQueryRunner.ts │ ├── cordova │ │ ├── CordovaConnectionOptions.ts │ │ ├── CordovaDriver.ts │ │ └── CordovaQueryRunner.ts │ ├── expo │ │ ├── ExpoConnectionOptions.ts │ │ ├── ExpoDriver.ts │ │ └── ExpoQueryRunner.ts │ ├── mongodb │ │ ├── MongoConnectionOptions.ts │ │ ├── MongoDriver.ts │ │ ├── MongoQueryRunner.ts │ │ └── typings.ts │ ├── mysql │ │ ├── MysqlConnectionCredentialsOptions.ts │ │ ├── MysqlConnectionOptions.ts │ │ ├── MysqlDriver.ts │ │ ├── MysqlQueryRunner.ts │ │ └── typings.ts │ ├── nativescript │ │ ├── NativescriptConnectionOptions.ts │ │ ├── NativescriptDriver.ts │ │ └── NativescriptQueryRunner.ts │ ├── oracle │ │ ├── OracleConnectionCredentialsOptions.ts │ │ ├── OracleConnectionOptions.ts │ │ ├── OracleDriver.ts │ │ └── OracleQueryRunner.ts │ ├── postgres │ │ ├── PostgresConnectionCredentialsOptions.ts │ │ ├── PostgresConnectionOptions.ts │ │ ├── PostgresDriver.ts │ │ ├── PostgresQueryRunner.ts │ │ └── typings.ts │ ├── react-native │ │ ├── ReactNativeConnectionOptions.ts │ │ ├── ReactNativeDriver.ts │ │ └── ReactNativeQueryRunner.ts │ ├── sap │ │ ├── SapConnectionCredentialsOptions.ts │ │ ├── SapConnectionOptions.ts │ │ ├── SapDriver.ts │ │ └── SapQueryRunner.ts │ ├── sqlite-abstract │ │ ├── AbstractSqliteDriver.ts │ │ └── AbstractSqliteQueryRunner.ts │ ├── sqlite │ │ ├── SqliteConnectionOptions.ts │ │ ├── SqliteDriver.ts │ │ ├── SqliteQueryRunner.ts │ │ └── typings.ts │ ├── sqljs │ │ ├── SqljsConnectionOptions.ts │ │ ├── SqljsDriver.ts │ │ └── SqljsQueryRunner.ts │ ├── sqlserver │ │ ├── MssqlParameter.ts │ │ ├── SqlServerConnectionCredentialsOptions.ts │ │ ├── SqlServerConnectionOptions.ts │ │ ├── SqlServerDriver.ts │ │ └── SqlServerQueryRunner.ts │ └── types │ │ ├── AutoSavable.ts │ │ ├── ColumnTypes.ts │ │ ├── DataTypeDefaults.ts │ │ ├── DatabaseType.ts │ │ ├── IsolationLevel.ts │ │ └── MappedColumnTypes.ts ├── entity-manager │ ├── EntityManager.ts │ ├── EntityManagerFactory.ts │ ├── MongoEntityManager.ts │ └── SqljsEntityManager.ts ├── entity-schema │ ├── EntitySchema.ts │ ├── EntitySchemaCheckOptions.ts │ ├── EntitySchemaColumnOptions.ts │ ├── EntitySchemaExclusionOptions.ts │ ├── EntitySchemaIndexOptions.ts │ ├── EntitySchemaOptions.ts │ ├── EntitySchemaRelationOptions.ts │ ├── EntitySchemaTransformer.ts │ └── EntitySchemaUniqueOptions.ts ├── error │ ├── AlreadyHasActiveConnectionError.ts │ ├── CannotAttachTreeChildrenEntityError.ts │ ├── CannotConnectAlreadyConnectedError.ts │ ├── CannotCreateEntityIdMapError.ts │ ├── CannotDetermineEntityError.ts │ ├── CannotExecuteNotConnectedError.ts │ ├── CannotGetEntityManagerNotConnectedError.ts │ ├── CannotReflectMethodParameterTypeError.ts │ ├── CircularRelationsError.ts │ ├── ColumnTypeUndefinedError.ts │ ├── ConnectionIsNotSetError.ts │ ├── ConnectionNotFoundError.ts │ ├── CustomRepositoryCannotInheritRepositoryError.ts │ ├── CustomRepositoryDoesNotHaveEntityError.ts │ ├── CustomRepositoryNotFoundError.ts │ ├── DataTypeNotSupportedError.ts │ ├── DriverOptionNotSetError.ts │ ├── DriverPackageNotInstalledError.ts │ ├── EntityColumnNotFound.ts │ ├── EntityMetadataNotFoundError.ts │ ├── EntityNotFoundError.ts │ ├── FindRelationsNotFoundError.ts │ ├── InitializedRelationError.ts │ ├── InsertValuesMissingError.ts │ ├── LimitOnUpdateNotSupportedError.ts │ ├── LockNotSupportedOnGivenDriverError.ts │ ├── MetadataAlreadyExistsError.ts │ ├── MetadataWithSuchNameAlreadyExistsError.ts │ ├── MissingDriverError.ts │ ├── MissingJoinColumnError.ts │ ├── MissingJoinTableError.ts │ ├── MissingPrimaryColumnError.ts │ ├── MustBeEntityError.ts │ ├── NamingStrategyNotFoundError.ts │ ├── NoConnectionForRepositoryError.ts │ ├── NoConnectionOptionError.ts │ ├── NoNeedToReleaseEntityManagerError.ts │ ├── NoVersionOrUpdateDateColumnError.ts │ ├── NotImplementedError.ts │ ├── OffsetWithoutLimitNotSupportedError.ts │ ├── OptimisticLockCanNotBeUsedError.ts │ ├── OptimisticLockVersionMismatchError.ts │ ├── PersistedEntityNotFoundError.ts │ ├── PessimisticLockTransactionRequiredError.ts │ ├── PrimaryColumnCannotBeNullableError.ts │ ├── QueryFailedError.ts │ ├── QueryRunnerAlreadyReleasedError.ts │ ├── QueryRunnerProviderAlreadyReleasedError.ts │ ├── RepositoryNotFoundError.ts │ ├── RepositoryNotTreeError.ts │ ├── ReturningStatementNotSupportedError.ts │ ├── SubjectRemovedAndUpdatedError.ts │ ├── SubjectWithoutIdentifierError.ts │ ├── TransactionAlreadyStartedError.ts │ ├── TransactionNotStartedError.ts │ ├── TreeRepositoryNotSupportedError.ts │ ├── UpdateValuesMissingError.ts │ ├── UsingJoinColumnIsNotAllowedError.ts │ ├── UsingJoinColumnOnlyOnOneSideAllowedError.ts │ ├── UsingJoinTableIsNotAllowedError.ts │ └── UsingJoinTableOnlyOnOneSideAllowedError.ts ├── find-options │ ├── FindConditions.ts │ ├── FindManyOptions.ts │ ├── FindOneOptions.ts │ ├── FindOperator.ts │ ├── FindOperatorType.ts │ ├── FindOptionsUtils.ts │ ├── JoinOptions.ts │ ├── OrderByCondition.ts │ └── operator │ │ ├── Any.ts │ │ ├── Between.ts │ │ ├── Equal.ts │ │ ├── In.ts │ │ ├── IsNull.ts │ │ ├── LessThan.ts │ │ ├── LessThanOrEqual.ts │ │ ├── Like.ts │ │ ├── MoreThan.ts │ │ ├── MoreThanOrEqual.ts │ │ ├── Not.ts │ │ └── Raw.ts ├── index.ts ├── logger │ ├── AdvancedConsoleLogger.ts │ ├── DebugLogger.ts │ ├── FileLogger.ts │ ├── Logger.ts │ ├── LoggerFactory.ts │ ├── LoggerOptions.ts │ └── SimpleConsoleLogger.ts ├── metadata-args │ ├── CheckMetadataArgs.ts │ ├── ColumnMetadataArgs.ts │ ├── DiscriminatorValueMetadataArgs.ts │ ├── EmbeddedMetadataArgs.ts │ ├── EntityListenerMetadataArgs.ts │ ├── EntityRepositoryMetadataArgs.ts │ ├── EntitySubscriberMetadataArgs.ts │ ├── ExclusionMetadataArgs.ts │ ├── GeneratedMetadataArgs.ts │ ├── IndexMetadataArgs.ts │ ├── InheritanceMetadataArgs.ts │ ├── JoinColumnMetadataArgs.ts │ ├── JoinTableMetadataArgs.ts │ ├── MetadataArgsStorage.ts │ ├── NamingStrategyMetadataArgs.ts │ ├── RelationCountMetadataArgs.ts │ ├── RelationIdMetadataArgs.ts │ ├── RelationMetadataArgs.ts │ ├── TableMetadataArgs.ts │ ├── TransactionEntityMetadataArgs.ts │ ├── TransactionRepositoryMetadataArgs.ts │ ├── TreeMetadataArgs.ts │ ├── UniqueMetadataArgs.ts │ └── types │ │ └── ColumnMode.ts ├── metadata-builder │ ├── ClosureJunctionEntityMetadataBuilder.ts │ ├── EntityMetadataBuilder.ts │ ├── EntityMetadataValidator.ts │ ├── JunctionEntityMetadataBuilder.ts │ ├── MetadataUtils.ts │ └── RelationJoinColumnBuilder.ts ├── metadata │ ├── CheckMetadata.ts │ ├── ColumnMetadata.ts │ ├── EmbeddedMetadata.ts │ ├── EntityListenerMetadata.ts │ ├── EntityMetadata.ts │ ├── ExclusionMetadata.ts │ ├── ForeignKeyMetadata.ts │ ├── IndexMetadata.ts │ ├── RelationCountMetadata.ts │ ├── RelationIdMetadata.ts │ ├── RelationMetadata.ts │ ├── UniqueMetadata.ts │ └── types │ │ ├── DeferrableType.ts │ │ ├── EventListenerTypes.ts │ │ ├── OnDeleteType.ts │ │ ├── OnUpdateType.ts │ │ ├── PropertyTypeInFunction.ts │ │ ├── RelationTypeInFunction.ts │ │ ├── RelationTypes.ts │ │ ├── TableTypes.ts │ │ └── TreeTypes.ts ├── migration │ ├── Migration.ts │ ├── MigrationExecutor.ts │ └── MigrationInterface.ts ├── naming-strategy │ ├── DefaultNamingStrategy.ts │ └── NamingStrategyInterface.ts ├── persistence │ ├── EntityPersistExecutor.ts │ ├── Subject.ts │ ├── SubjectChangeMap.ts │ ├── SubjectChangedColumnsComputer.ts │ ├── SubjectDatabaseEntityLoader.ts │ ├── SubjectExecutor.ts │ ├── SubjectTopoligicalSorter.ts │ ├── subject-builder │ │ ├── CascadesSubjectBuilder.ts │ │ ├── ManyToManySubjectBuilder.ts │ │ ├── OneToManySubjectBuilder.ts │ │ └── OneToOneInverseSideSubjectBuilder.ts │ └── tree │ │ ├── ClosureSubjectExecutor.ts │ │ ├── MaterializedPathSubjectExecutor.ts │ │ └── NestedSetSubjectExecutor.ts ├── platform │ ├── BrowserDisabledDriversDummy.template │ ├── BrowserPlatformTools.template │ └── PlatformTools.ts ├── query-builder │ ├── AbstractQueryBuilderFactory.ts │ ├── Alias.ts │ ├── Brackets.ts │ ├── DeleteQueryBuilder.ts │ ├── InsertQueryBuilder.ts │ ├── JoinAttribute.ts │ ├── JoinOptions.ts │ ├── QueryBuilder.ts │ ├── QueryBuilderFactory.ts │ ├── QueryBuilderUtils.ts │ ├── QueryExpressionMap.ts │ ├── QueryPartialEntity.ts │ ├── RelationIdLoader.ts │ ├── RelationLoader.ts │ ├── RelationQueryBuilder.ts │ ├── RelationRemover.ts │ ├── RelationUpdater.ts │ ├── ReturningResultsEntityUpdator.ts │ ├── SelectQuery.ts │ ├── SelectQueryBuilder.ts │ ├── SelectQueryBuilderOption.ts │ ├── UpdateQueryBuilder.ts │ ├── WhereExpression.ts │ ├── relation-count │ │ ├── RelationCountAttribute.ts │ │ ├── RelationCountLoadResult.ts │ │ ├── RelationCountLoader.ts │ │ └── RelationCountMetadataToAttributeTransformer.ts │ ├── relation-id │ │ ├── RelationIdAttribute.ts │ │ ├── RelationIdLoadResult.ts │ │ ├── RelationIdLoader.ts │ │ └── RelationIdMetadataToAttributeTransformer.ts │ ├── result │ │ ├── DeleteResult.ts │ │ ├── InsertResult.ts │ │ └── UpdateResult.ts │ └── transformer │ │ ├── DocumentToEntityTransformer.ts │ │ ├── PlainObjectToDatabaseEntityTransformer.ts │ │ ├── PlainObjectToNewEntityTransformer.ts │ │ └── RawSqlResultsToEntityTransformer.ts ├── query-runner │ ├── BaseQueryRunner.ts │ └── QueryRunner.ts ├── repository │ ├── AbstractRepository.ts │ ├── BaseEntity.ts │ ├── EntityId.ts │ ├── MongoRepository.ts │ ├── RemoveOptions.ts │ ├── Repository.ts │ ├── RepositoryFactory.ts │ ├── SaveOptions.ts │ └── TreeRepository.ts ├── schema-builder │ ├── MongoSchemaBuilder.ts │ ├── RdbmsSchemaBuilder.ts │ ├── SchemaBuilder.ts │ ├── options │ │ ├── TableCheckOptions.ts │ │ ├── TableColumnOptions.ts │ │ ├── TableExclusionOptions.ts │ │ ├── TableForeignKeyOptions.ts │ │ ├── TableIndexOptions.ts │ │ ├── TableOptions.ts │ │ ├── TableUniqueOptions.ts │ │ └── ViewOptions.ts │ ├── table │ │ ├── Table.ts │ │ ├── TableCheck.ts │ │ ├── TableColumn.ts │ │ ├── TableExclusion.ts │ │ ├── TableForeignKey.ts │ │ ├── TableIndex.ts │ │ └── TableUnique.ts │ ├── util │ │ └── TableUtils.ts │ └── view │ │ └── View.ts ├── subscriber │ ├── Broadcaster.ts │ ├── BroadcasterResult.ts │ ├── EntitySubscriberInterface.ts │ └── event │ │ ├── InsertEvent.ts │ │ ├── LoadEvent.ts │ │ ├── RemoveEvent.ts │ │ └── UpdateEvent.ts ├── util │ ├── ApplyValueTransformers.ts │ ├── DateUtils.ts │ ├── DepGraph.ts │ ├── DirectoryExportedClassesLoader.ts │ ├── ObjectUtils.ts │ ├── OrmUtils.ts │ ├── PromiseQueue.ts │ ├── PromiseUtils.ts │ ├── RandomGenerator.ts │ ├── SqlUtils.ts │ ├── StringUtils.ts │ ├── VersionUtils.ts │ └── fs.ts └── version.ts ├── temp └── .gitignore ├── test.ts ├── test ├── benchmark │ ├── bulk-save-case1 │ │ ├── bulk-save-case1.ts │ │ └── entity │ │ │ └── Post.ts │ ├── bulk-save-case2 │ │ ├── bulk-save-case2.ts │ │ └── entity │ │ │ └── Document.ts │ └── bulk-save-querybuilder │ │ └── bulk-save-querybuilder.ts ├── denolib-issues │ ├── 70 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-70.ts │ └── 90 │ │ └── issue-90.ts ├── deps │ ├── chai.ts │ ├── global.ts │ ├── mocha.ts │ └── sinon.ts ├── functional │ ├── cascades │ │ └── cascade-insert-from-both-sides │ │ │ ├── cascade-insert-from-both-sides.ts │ │ │ └── entity │ │ │ ├── Post.ts │ │ │ └── PostDetails.ts │ ├── columns │ │ ├── embedded-columns │ │ │ ├── columns-embedded-columns.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Information.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── SimpleCounters.ts │ │ │ │ └── SimplePost.ts │ │ ├── getters-setters │ │ │ ├── columns-getters-setters.ts │ │ │ └── entity │ │ │ │ └── Post.ts │ │ ├── no-select │ │ │ ├── columns-no-select.ts │ │ │ └── entity │ │ │ │ └── Post.ts │ │ ├── readonly │ │ │ ├── columns-readonly.ts │ │ │ └── entity │ │ │ │ └── Post.ts │ │ ├── update-insert │ │ │ ├── columns-update-insert.ts │ │ │ └── entity │ │ │ │ └── Post.ts │ │ └── value-transformer │ │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── PhoneBook.ts │ │ │ ├── Post.ts │ │ │ ├── User.ts │ │ │ └── View.ts │ │ │ └── value-transformer.ts │ ├── connection-manager │ │ └── connection-manager.ts │ ├── connection-options-reader │ │ ├── configs │ │ │ ├── .env │ │ │ ├── class-entities.ts │ │ │ ├── config.yml │ │ │ ├── sqlite-memory.ts │ │ │ ├── test-path-config-async.js │ │ │ └── test-path-config.js │ │ └── connection-options-reader.ts │ ├── connection │ │ ├── connection.ts │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── Post.ts │ │ │ ├── View.ts │ │ │ ├── v1 │ │ │ │ ├── Comment.ts │ │ │ │ └── Guest.ts │ │ │ └── v2 │ │ │ │ ├── Comment.ts │ │ │ │ └── Guest.ts │ │ ├── modules │ │ │ ├── blog │ │ │ │ ├── entity │ │ │ │ │ └── Blog.ts │ │ │ │ ├── schema │ │ │ │ │ └── blog-category.json │ │ │ │ └── subscriber │ │ │ │ │ └── TestBlogSubscriber.ts │ │ │ ├── question │ │ │ │ ├── entity │ │ │ │ │ └── Question.ts │ │ │ │ ├── schema │ │ │ │ │ └── question-category.json │ │ │ │ └── subscriber │ │ │ │ │ └── TestQuestionSubscriber.ts │ │ │ └── video │ │ │ │ ├── entity │ │ │ │ └── Video.ts │ │ │ │ ├── schema │ │ │ │ └── video-category.json │ │ │ │ └── subscriber │ │ │ │ └── TestVideoSubscriber.ts │ │ ├── naming-strategy │ │ │ ├── FirstCustomNamingStrategy.ts │ │ │ └── SecondCustomNamingStrategy.ts │ │ ├── schema │ │ │ ├── photo.json │ │ │ └── user.json │ │ └── subscriber │ │ │ ├── FirstConnectionSubscriber.ts │ │ │ └── SecondConnectionSubscriber.ts │ ├── cube │ │ └── postgres │ │ │ ├── cube-postgres.ts │ │ │ └── entity │ │ │ └── Post.ts │ ├── database-schema │ │ ├── column-collation │ │ │ ├── cockroach │ │ │ │ ├── column-collation-cockroach.ts │ │ │ │ └── entity │ │ │ │ │ └── Post.ts │ │ │ ├── mssql │ │ │ │ ├── column-collation-mssql.ts │ │ │ │ └── entity │ │ │ │ │ └── Post.ts │ │ │ ├── mysql │ │ │ │ ├── column-collation-mysql.ts │ │ │ │ └── entity │ │ │ │ │ └── Post.ts │ │ │ ├── postgres │ │ │ │ ├── column-collation-postgres.ts │ │ │ │ └── entity │ │ │ │ │ └── Post.ts │ │ │ └── sqlite │ │ │ │ ├── column-collation-sqlite.ts │ │ │ │ └── entity │ │ │ │ └── Post.ts │ │ ├── column-length │ │ │ ├── mssql │ │ │ │ ├── column-length-mssql.ts │ │ │ │ └── entity │ │ │ │ │ └── Post.ts │ │ │ ├── mysql │ │ │ │ ├── column-length-mysql.ts │ │ │ │ └── entity │ │ │ │ │ └── Post.ts │ │ │ ├── postgres │ │ │ │ ├── column-length-postgres.ts │ │ │ │ └── entity │ │ │ │ │ └── Post.ts │ │ │ ├── sap │ │ │ │ ├── column-length-sap.ts │ │ │ │ └── entity │ │ │ │ │ └── Post.ts │ │ │ └── sqlite │ │ │ │ ├── column-length-sqlite.ts │ │ │ │ └── entity │ │ │ │ └── Post.ts │ │ ├── column-types │ │ │ ├── cockroachdb │ │ │ │ ├── column-types-cockroach.ts │ │ │ │ └── entity │ │ │ │ │ ├── Post.ts │ │ │ │ │ ├── PostWithOptions.ts │ │ │ │ │ └── PostWithoutTypes.ts │ │ │ ├── mssql │ │ │ │ ├── column-types-mssql.ts │ │ │ │ ├── entity │ │ │ │ │ ├── Post.ts │ │ │ │ │ ├── PostWithOptions.ts │ │ │ │ │ └── PostWithoutTypes.ts │ │ │ │ └── enum │ │ │ │ │ └── FruitEnum.ts │ │ │ ├── mysql │ │ │ │ ├── column-types-mysql.ts │ │ │ │ ├── entity │ │ │ │ │ ├── Post.ts │ │ │ │ │ ├── PostWithOptions.ts │ │ │ │ │ └── PostWithoutTypes.ts │ │ │ │ └── enum │ │ │ │ │ └── FruitEnum.ts │ │ │ ├── oracle │ │ │ │ ├── column-types-oracle.ts │ │ │ │ └── entity │ │ │ │ │ ├── Post.ts │ │ │ │ │ ├── PostWithOptions.ts │ │ │ │ │ └── PostWithoutTypes.ts │ │ │ ├── postgres-enum │ │ │ │ ├── entity │ │ │ │ │ └── Post.ts │ │ │ │ └── postgres-enum.ts │ │ │ ├── postgres │ │ │ │ ├── column-types-postgres.ts │ │ │ │ └── entity │ │ │ │ │ ├── Post.ts │ │ │ │ │ ├── PostWithOptions.ts │ │ │ │ │ └── PostWithoutTypes.ts │ │ │ ├── sap │ │ │ │ ├── column-types-sap.ts │ │ │ │ └── entity │ │ │ │ │ ├── Post.ts │ │ │ │ │ ├── PostWithOptions.ts │ │ │ │ │ └── PostWithoutTypes.ts │ │ │ └── sqlite │ │ │ │ ├── column-types-sqlite.ts │ │ │ │ ├── entity │ │ │ │ ├── Post.ts │ │ │ │ └── PostWithoutTypes.ts │ │ │ │ └── enum │ │ │ │ └── FruitEnum.ts │ │ ├── column-width │ │ │ └── mysql │ │ │ │ ├── column-width.ts │ │ │ │ └── entity │ │ │ │ └── Post.ts │ │ ├── enums-array │ │ │ ├── entity │ │ │ │ └── EnumArrayEntity.ts │ │ │ └── enums-array.ts │ │ ├── enums │ │ │ ├── entity │ │ │ │ └── EnumEntity.ts │ │ │ └── enums.ts │ │ ├── indices │ │ │ ├── entity │ │ │ │ └── Person.ts │ │ │ └── indices-create-modify.ts │ │ ├── mssql-parameters │ │ │ ├── entity │ │ │ │ └── Post.ts │ │ │ └── mssql-parameters.ts │ │ ├── rowid-column │ │ │ ├── entity │ │ │ │ └── Person.ts │ │ │ └── rowid-column.ts │ │ ├── sequences │ │ │ ├── entity │ │ │ │ └── Person.ts │ │ │ └── sequence-create-test.ts │ │ ├── simple-enums-array │ │ │ ├── entity │ │ │ │ └── EnumArrayEntity.ts │ │ │ └── enums-array.ts │ │ └── simple-enums │ │ │ ├── entity │ │ │ └── SimpleEnumEntity.ts │ │ │ └── enums.ts │ ├── decorators │ │ ├── embedded │ │ │ ├── entity │ │ │ │ ├── Counters.ts │ │ │ │ └── Post.ts │ │ │ └── query-builder-embedded.ts │ │ ├── relation-count │ │ │ ├── relation-count-many-to-many │ │ │ │ ├── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ ├── Image.ts │ │ │ │ │ └── Post.ts │ │ │ │ └── relation-count-decorator-many-to-many.ts │ │ │ └── relation-count-one-to-many │ │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Image.ts │ │ │ │ └── Post.ts │ │ │ │ └── relation-count-decorator-one-to-many.ts │ │ └── relation-id │ │ │ ├── relation-id-many-to-many │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Image.ts │ │ │ │ └── Post.ts │ │ │ └── relation-id-decorator-many-to-many.ts │ │ │ ├── relation-id-many-to-one │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ └── relation-id-decorator-many-to-one.ts │ │ │ ├── relation-id-one-to-many │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ └── relation-id-decorator-one-to-many.ts │ │ │ └── relation-id-one-to-one │ │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ │ └── relation-id-decorator-one-to-one.ts │ ├── deferrable │ │ ├── deferrable.ts │ │ └── entity │ │ │ ├── Company.ts │ │ │ ├── Office.ts │ │ │ └── User.ts │ ├── driver │ │ └── convert-to-entity │ │ │ ├── convert-to-entity.ts │ │ │ └── entity │ │ │ └── Post.ts │ ├── embedded │ │ ├── basic-functionality │ │ │ ├── basic-functionality.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ └── Post.ts │ │ ├── embedded-listeners │ │ │ ├── embedded-listeners.ts │ │ │ └── entity │ │ │ │ ├── Post.ts │ │ │ │ ├── PostCounter.ts │ │ │ │ └── PostInformation.ts │ │ ├── embedded-many-to-many-case1 │ │ │ ├── embedded-many-to-many-case1.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── Subcounters.ts │ │ │ │ └── User.ts │ │ ├── embedded-many-to-many-case2 │ │ │ ├── embedded-many-to-many-case2.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── Subcounters.ts │ │ │ │ └── User.ts │ │ ├── embedded-many-to-many-case3 │ │ │ ├── embedded-many-to-many-case3.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── Subcounters.ts │ │ │ │ └── User.ts │ │ ├── embedded-many-to-many-case4 │ │ │ ├── embedded-many-to-many-case4.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── Subcounters.ts │ │ │ │ └── User.ts │ │ ├── embedded-many-to-many-case5 │ │ │ ├── embedded-many-to-many-case5.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── Subcounters.ts │ │ │ │ └── User.ts │ │ ├── embedded-many-to-one-case1 │ │ │ ├── embedded-many-to-one-case1.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── Subcounters.ts │ │ │ │ └── User.ts │ │ ├── embedded-many-to-one-case2 │ │ │ ├── embedded-many-to-one-case2.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── Subcounters.ts │ │ │ │ └── User.ts │ │ ├── embedded-many-to-one-case3 │ │ │ ├── embedded-many-to-one-case3.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── Subcounters.ts │ │ │ │ └── User.ts │ │ ├── embedded-many-to-one-case4 │ │ │ ├── embedded-many-to-one-case4.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── Subcounters.ts │ │ │ │ └── User.ts │ │ ├── embedded-many-to-one-case5 │ │ │ ├── embedded-many-to-one-case5.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── Subcounters.ts │ │ │ │ └── User.ts │ │ ├── embedded-one-to-one │ │ │ ├── embedded-one-to-one.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── Subcounters.ts │ │ │ │ └── User.ts │ │ ├── embedded-with-special-columns │ │ │ ├── embedded-with-special-columns.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ └── Subcounters.ts │ │ ├── multiple-primary-columns-with-nested-embed │ │ │ ├── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ └── Subcounters.ts │ │ │ └── multiple-primary-columns-with-nested-embed.ts │ │ ├── multiple-primary-columns │ │ │ ├── entity │ │ │ │ ├── Counters.ts │ │ │ │ └── Post.ts │ │ │ └── multiple-primary-columns.ts │ │ ├── optional-embedded-listeners │ │ │ ├── entity │ │ │ │ ├── Post.ts │ │ │ │ ├── PostCounter.ts │ │ │ │ └── PostInformation.ts │ │ │ └── optional-embedded-listeners.ts │ │ ├── outer-primary-column │ │ │ ├── entity │ │ │ │ ├── Counters.ts │ │ │ │ └── Post.ts │ │ │ └── outer-primary-column.ts │ │ └── prefix │ │ │ ├── embedded-prefix.ts │ │ │ └── entity │ │ │ ├── Counters.ts │ │ │ └── Post.ts │ ├── entity-listeners │ │ ├── entity-listeners.ts │ │ └── entity │ │ │ └── Post.ts │ ├── entity-metadata-validator │ │ ├── basic │ │ │ ├── entity-metadata-validator.ts │ │ │ └── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ └── initialized-relations │ │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── Image.ts │ │ │ ├── ImageInfo.ts │ │ │ ├── Post.ts │ │ │ └── Question.ts │ │ │ └── validator-intialized-relations.ts │ ├── entity-metadata │ │ ├── entity-metadata-property-map.ts │ │ └── entity │ │ │ ├── Counters.ts │ │ │ ├── Post.ts │ │ │ ├── Subcounters.ts │ │ │ └── User.ts │ ├── entity-model │ │ ├── entity-model.ts │ │ └── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ ├── entity-schema │ │ ├── basic │ │ │ ├── entity-schema-basic.ts │ │ │ ├── entity │ │ │ │ ├── CategoryEntity.ts │ │ │ │ └── PostEntity.ts │ │ │ └── model │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ ├── checks │ │ │ ├── checks-basic.ts │ │ │ └── entity │ │ │ │ └── Person.ts │ │ ├── columns │ │ │ └── mysql │ │ │ │ ├── columns-mysql.ts │ │ │ │ └── entity │ │ │ │ └── Person.ts │ │ ├── exclusions │ │ │ ├── entity │ │ │ │ └── Meeting.ts │ │ │ └── exclusions-basic.ts │ │ ├── indices │ │ │ ├── basic │ │ │ │ ├── entity │ │ │ │ │ └── Person.ts │ │ │ │ └── indices-basic.ts │ │ │ └── mysql │ │ │ │ ├── entity │ │ │ │ └── Person.ts │ │ │ │ └── indices-mysql.ts │ │ ├── target │ │ │ ├── entity-schema-target.ts │ │ │ ├── entity │ │ │ │ └── PostEntity.ts │ │ │ └── model │ │ │ │ └── Post.ts │ │ └── uniques │ │ │ ├── entity │ │ │ └── Person.ts │ │ │ └── uniques-basic.ts │ ├── indices │ │ ├── basic-unique-index-test │ │ │ ├── basic-unique-index-test.ts │ │ │ └── entity │ │ │ │ └── Customer.ts │ │ ├── conditional-index │ │ │ ├── conditional-index.ts │ │ │ └── entity │ │ │ │ └── Post.ts │ │ └── embeddeds-index-test │ │ │ ├── embeddeds-unique-index-test.ts │ │ │ └── entity │ │ │ ├── Customer.ts │ │ │ └── Profile.ts │ ├── json │ │ ├── entity │ │ │ └── Record.ts │ │ └── jsonb.ts │ ├── metadata-builder │ │ ├── column-metadata │ │ │ ├── column-metadata.ts │ │ │ └── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Post.ts │ │ │ │ └── Subcounters.ts │ │ └── metadata-args-storage │ │ │ ├── entity │ │ │ ├── ContentModule.ts │ │ │ ├── Post.ts │ │ │ └── Unit.ts │ │ │ └── metadata-args-storage.ts │ ├── migrations │ │ └── show-command │ │ │ ├── command.ts │ │ │ └── migration │ │ │ ├── 1530542855524-ExampleMigration.ts │ │ │ └── 1530542855524-ExampleMigrationTwo.ts │ ├── mongodb │ │ └── basic │ │ │ ├── array-columns │ │ │ ├── entity │ │ │ │ ├── Counters.ts │ │ │ │ └── Post.ts │ │ │ └── mongodb-array-columns.ts │ │ │ ├── embedded-columns-listeners │ │ │ ├── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Information.ts │ │ │ │ └── Post.ts │ │ │ └── mongodb-embedded-columns-listeners.ts │ │ │ ├── embedded-columns │ │ │ ├── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── EditHistory.ts │ │ │ │ ├── ExtraInformation.ts │ │ │ │ ├── Information.ts │ │ │ │ └── Post.ts │ │ │ └── mongodb-embedded-columns.ts │ │ │ ├── mongo-embeddeds-index │ │ │ ├── entity │ │ │ │ ├── Information.ts │ │ │ │ └── Post.ts │ │ │ └── mongo-embeddeds-index.ts │ │ │ ├── mongo-index │ │ │ ├── entity │ │ │ │ └── Post.ts │ │ │ └── mongo-index.ts │ │ │ ├── mongo-repository │ │ │ ├── entity │ │ │ │ └── Post.ts │ │ │ └── mongo-repository.ts │ │ │ ├── object-id │ │ │ ├── entity │ │ │ │ ├── Post.ts │ │ │ │ └── PostWithUnderscoreId.ts │ │ │ └── mongodb-object-id.ts │ │ │ ├── repository-actions │ │ │ ├── entity │ │ │ │ └── Post.ts │ │ │ └── mongodb-repository-actions.ts │ │ │ └── timestampable-columns │ │ │ ├── entity │ │ │ └── Post.ts │ │ │ └── timestampable-columns.ts │ ├── multi-schema-and-database │ │ ├── custom-junction-database │ │ │ ├── custom-junction-database.ts │ │ │ └── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ ├── custom-junction-schema │ │ │ ├── custom-junction-schema.ts │ │ │ └── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ └── multi-schema-and-database-basic-functionality │ │ │ ├── entity │ │ │ ├── Answer.ts │ │ │ ├── Category.ts │ │ │ ├── Person.ts │ │ │ ├── Post.ts │ │ │ ├── Question.ts │ │ │ └── User.ts │ │ │ └── multi-schema-and-database-basic-functionality.ts │ ├── ormconfigs │ │ └── all │ │ │ ├── ormconfig.env │ │ │ ├── ormconfig.js │ │ │ ├── ormconfig.xml │ │ │ └── ormconfig.yml │ ├── persistence │ │ ├── basic-functionality │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Post.ts │ │ │ │ └── User.ts │ │ │ └── persistence-basic-functionality.ts │ │ ├── bulk-insert-remove-optimization │ │ │ ├── bulk-insert-remove-optimization.ts │ │ │ └── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ ├── cascades │ │ │ ├── cascades-example1 │ │ │ │ ├── cascades-example1.ts │ │ │ │ └── entity │ │ │ │ │ ├── Photo.ts │ │ │ │ │ ├── Profile.ts │ │ │ │ │ └── User.ts │ │ │ ├── cascades-example2 │ │ │ │ ├── cascades-example2.ts │ │ │ │ └── entity │ │ │ │ │ ├── Answer.ts │ │ │ │ │ ├── Photo.ts │ │ │ │ │ ├── Question.ts │ │ │ │ │ └── User.ts │ │ │ └── cascades-remove │ │ │ │ ├── cascades-remove.ts │ │ │ │ └── entity │ │ │ │ ├── Photo.ts │ │ │ │ └── User.ts │ │ ├── custom-column-name-pk │ │ │ ├── custom-column-name-pk.ts │ │ │ └── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ ├── custom-column-names │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── CategoryMetadata.ts │ │ │ │ └── Post.ts │ │ │ └── persistence-custom-column-names.ts │ │ ├── entity-updation │ │ │ ├── entity │ │ │ │ ├── PostComplex.ts │ │ │ │ ├── PostDefaultValues.ts │ │ │ │ ├── PostEmbedded.ts │ │ │ │ ├── PostIncrement.ts │ │ │ │ ├── PostMultiplePrimaryKeys.ts │ │ │ │ ├── PostSpecialColumns.ts │ │ │ │ └── PostUuid.ts │ │ │ └── persistence-entity-updation.ts │ │ ├── insert │ │ │ └── update-relation-columns-after-insertion │ │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ │ └── update-relation-columns-after-insertion.ts │ │ ├── many-to-many │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Post.ts │ │ │ │ └── User.ts │ │ │ └── persistence-many-to-many.ts │ │ ├── many-to-one-bi-directional │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ └── persistence-many-to-one-bi-directional.ts │ │ ├── many-to-one-uni-directional │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ └── persistence-many-to-one-uni-directional.ts │ │ ├── multi-primary-key-on-both-sides │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ └── multi-primary-key.ts │ │ ├── multi-primary-key │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ └── multi-primary-key.ts │ │ ├── null-and-default-behaviour │ │ │ ├── entity │ │ │ │ └── Post.ts │ │ │ └── null-and-default-behaviour.ts │ │ ├── one-to-many │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ └── persistence-one-to-many.ts │ │ ├── one-to-one │ │ │ ├── entity │ │ │ │ ├── AccessToken.ts │ │ │ │ └── User.ts │ │ │ └── persistence-one-to-one.ts │ │ ├── partial-persist │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Counters.ts │ │ │ │ └── Post.ts │ │ │ └── partial-persist.ts │ │ ├── persistence-options │ │ │ ├── chunks │ │ │ │ ├── entity │ │ │ │ │ └── Post.ts │ │ │ │ └── persistence-options-chunks.ts │ │ │ ├── listeners │ │ │ │ ├── entity │ │ │ │ │ └── Post.ts │ │ │ │ └── persistence-options-listeners.ts │ │ │ └── transaction │ │ │ │ ├── entity │ │ │ │ └── Post.ts │ │ │ │ └── persistence-options-transaction.ts │ │ ├── persistence-order │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Details.ts │ │ │ │ ├── Photo.ts │ │ │ │ └── Post.ts │ │ │ └── persistence-order.ts │ │ └── remove-topological-order │ │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ │ └── remove-topolotical-order.ts │ ├── query-builder │ │ ├── brackets │ │ │ ├── entity │ │ │ │ └── User.ts │ │ │ └── query-builder-brackets.ts │ │ ├── cache │ │ │ ├── entity │ │ │ │ └── User.ts │ │ │ └── query-builder-cache.ts │ │ ├── delete │ │ │ ├── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Photo.ts │ │ │ │ └── User.ts │ │ │ └── query-builder-delete.ts │ │ ├── distinct-on │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Post.ts │ │ │ │ └── User.ts │ │ │ └── query-builder-distinct-on.ts │ │ ├── enabling-transaction │ │ │ ├── enabling-transaction.ts │ │ │ └── entity │ │ │ │ └── Post.ts │ │ ├── entity-updation │ │ │ ├── entity-updation.ts │ │ │ └── entity │ │ │ │ └── Post.ts │ │ ├── insert-on-conflict │ │ │ ├── entity │ │ │ │ └── Post.ts │ │ │ └── query-builder-insert-on-conflict.ts │ │ ├── insert │ │ │ ├── entity │ │ │ │ ├── Counters.ts │ │ │ │ ├── Photo.ts │ │ │ │ ├── Post.ts │ │ │ │ └── User.ts │ │ │ └── query-builder-insert.ts │ │ ├── join │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Image.ts │ │ │ │ ├── Post.ts │ │ │ │ ├── Tag.ts │ │ │ │ └── User.ts │ │ │ └── query-builder-joins.ts │ │ ├── locking │ │ │ ├── entity │ │ │ │ ├── PostWithUpdateDate.ts │ │ │ │ ├── PostWithVersion.ts │ │ │ │ ├── PostWithVersionAndUpdatedDate.ts │ │ │ │ └── PostWithoutVersionAndUpdateDate.ts │ │ │ └── query-builder-locking.ts │ │ ├── order-by │ │ │ ├── entity │ │ │ │ └── Post.ts │ │ │ └── query-builder-order-by.ts │ │ ├── relation-count │ │ │ ├── relation-count-many-to-many │ │ │ │ ├── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ ├── Image.ts │ │ │ │ │ └── Post.ts │ │ │ │ └── load-relation-count-and-map-many-to-many.ts │ │ │ └── relation-count-one-to-many │ │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Image.ts │ │ │ │ └── Post.ts │ │ │ │ └── load-relation-count-and-map-one-to-many.ts │ │ ├── relation-id │ │ │ ├── many-to-many │ │ │ │ ├── basic-functionality │ │ │ │ │ ├── basic-functionality.ts │ │ │ │ │ └── entity │ │ │ │ │ │ ├── Category.ts │ │ │ │ │ │ ├── Image.ts │ │ │ │ │ │ ├── Post.ts │ │ │ │ │ │ └── Tag.ts │ │ │ │ ├── embedded-with-multiple-pk │ │ │ │ │ ├── embedded-with-multiple-pk.ts │ │ │ │ │ └── entity │ │ │ │ │ │ ├── Category.ts │ │ │ │ │ │ ├── Counters.ts │ │ │ │ │ │ ├── Post.ts │ │ │ │ │ │ ├── Subcounters.ts │ │ │ │ │ │ └── User.ts │ │ │ │ ├── embedded │ │ │ │ │ ├── embedded.ts │ │ │ │ │ └── entity │ │ │ │ │ │ ├── Category.ts │ │ │ │ │ │ ├── Counters.ts │ │ │ │ │ │ ├── Post.ts │ │ │ │ │ │ ├── Subcounters.ts │ │ │ │ │ │ └── User.ts │ │ │ │ └── multiple-pk │ │ │ │ │ ├── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ ├── Image.ts │ │ │ │ │ └── Post.ts │ │ │ │ │ └── multiple-pk.ts │ │ │ ├── many-to-one │ │ │ │ ├── basic-functionality │ │ │ │ │ ├── basic-functionality.ts │ │ │ │ │ └── entity │ │ │ │ │ │ ├── Category.ts │ │ │ │ │ │ ├── Image.ts │ │ │ │ │ │ ├── Post.ts │ │ │ │ │ │ └── PostCategory.ts │ │ │ │ ├── embedded-with-multiple-pk │ │ │ │ │ ├── embedded-with-multiple-pk.ts │ │ │ │ │ └── entity │ │ │ │ │ │ ├── Category.ts │ │ │ │ │ │ ├── Counters.ts │ │ │ │ │ │ ├── Post.ts │ │ │ │ │ │ ├── Subcounters.ts │ │ │ │ │ │ └── User.ts │ │ │ │ ├── embedded │ │ │ │ │ ├── embedded.ts │ │ │ │ │ └── entity │ │ │ │ │ │ ├── Category.ts │ │ │ │ │ │ ├── Counters.ts │ │ │ │ │ │ ├── Post.ts │ │ │ │ │ │ ├── Subcounters.ts │ │ │ │ │ │ └── User.ts │ │ │ │ └── multiple-pk │ │ │ │ │ ├── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ ├── Image.ts │ │ │ │ │ └── Post.ts │ │ │ │ │ └── multiple-pk.ts │ │ │ ├── one-to-many │ │ │ │ ├── basic-functionality │ │ │ │ │ ├── basic-functionality.ts │ │ │ │ │ └── entity │ │ │ │ │ │ ├── Category.ts │ │ │ │ │ │ ├── Image.ts │ │ │ │ │ │ └── Post.ts │ │ │ │ ├── embedded-with-multiple-pk │ │ │ │ │ ├── embedded-with-multiple-pk.ts │ │ │ │ │ └── entity │ │ │ │ │ │ ├── Category.ts │ │ │ │ │ │ ├── Counters.ts │ │ │ │ │ │ ├── Post.ts │ │ │ │ │ │ ├── Subcounters.ts │ │ │ │ │ │ └── User.ts │ │ │ │ ├── embedded │ │ │ │ │ ├── embedded.ts │ │ │ │ │ └── entity │ │ │ │ │ │ ├── Category.ts │ │ │ │ │ │ ├── Counters.ts │ │ │ │ │ │ ├── Post.ts │ │ │ │ │ │ ├── Subcounters.ts │ │ │ │ │ │ └── User.ts │ │ │ │ └── multiple-pk │ │ │ │ │ ├── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ ├── Image.ts │ │ │ │ │ └── Post.ts │ │ │ │ │ └── multiple-pk.ts │ │ │ └── one-to-one │ │ │ │ ├── basic-functionality │ │ │ │ ├── basic-functionality.ts │ │ │ │ └── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ └── Post.ts │ │ │ │ ├── embedded-with-multiple-pk │ │ │ │ ├── embedded-with-multiple-pk.ts │ │ │ │ └── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ ├── Counters.ts │ │ │ │ │ ├── Post.ts │ │ │ │ │ ├── Subcounters.ts │ │ │ │ │ └── User.ts │ │ │ │ ├── embedded │ │ │ │ ├── embedded.ts │ │ │ │ └── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ ├── Counters.ts │ │ │ │ │ ├── Post.ts │ │ │ │ │ ├── Subcounters.ts │ │ │ │ │ └── User.ts │ │ │ │ └── multiple-pk │ │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Image.ts │ │ │ │ └── Post.ts │ │ │ │ └── multiple-pk.ts │ │ ├── relational │ │ │ ├── with-many │ │ │ │ ├── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ ├── Image.ts │ │ │ │ │ └── Post.ts │ │ │ │ ├── query-builder-relational-add-remove-many-to-many-inverse.ts │ │ │ │ ├── query-builder-relational-add-remove-many-to-many.ts │ │ │ │ ├── query-builder-relational-add-remove-one-to-many.ts │ │ │ │ └── query-builder-relational-load-many.ts │ │ │ └── with-one │ │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Image.ts │ │ │ │ └── Post.ts │ │ │ │ ├── query-builder-relational-load-one.ts │ │ │ │ ├── query-builder-relational-set-many-to-one.ts │ │ │ │ ├── query-builder-relational-set-one-to-one-inverse.ts │ │ │ │ └── query-builder-relational-set-one-to-one.ts │ │ ├── select │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ └── query-builder-select.ts │ │ ├── subquery │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Post.ts │ │ │ │ └── User.ts │ │ │ └── query-builder-subquery.ts │ │ └── update │ │ │ ├── entity │ │ │ ├── Counters.ts │ │ │ ├── Photo.ts │ │ │ └── User.ts │ │ │ └── query-builder-update.ts │ ├── query-runner │ │ ├── add-column.ts │ │ ├── change-column.ts │ │ ├── create-and-drop-database.ts │ │ ├── create-and-drop-schema.ts │ │ ├── create-check-constraint.ts │ │ ├── create-exclusion-constraint.ts │ │ ├── create-foreign-key.ts │ │ ├── create-index.ts │ │ ├── create-primary-key.ts │ │ ├── create-table.ts │ │ ├── create-unique-constraint.ts │ │ ├── drop-check-constraint.ts │ │ ├── drop-column.ts │ │ ├── drop-exclusion-constraint.ts │ │ ├── drop-foreign-key.ts │ │ ├── drop-index.ts │ │ ├── drop-primary-key.ts │ │ ├── drop-table.ts │ │ ├── drop-unique-constraint.ts │ │ ├── entity │ │ │ ├── Book.ts │ │ │ ├── Faculty.ts │ │ │ ├── Photo.ts │ │ │ ├── Post.ts │ │ │ ├── Student.ts │ │ │ └── Teacher.ts │ │ ├── rename-column.ts │ │ └── rename-table.ts │ ├── relations │ │ ├── custom-referenced-column-name │ │ │ ├── custom-referenced-column-name.ts │ │ │ └── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Post.ts │ │ │ │ └── Tag.ts │ │ ├── eager-relations │ │ │ ├── basic-eager-relations │ │ │ │ ├── basic-eager-relations.ts │ │ │ │ └── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ ├── Editor.ts │ │ │ │ │ ├── Post.ts │ │ │ │ │ ├── Profile.ts │ │ │ │ │ └── User.ts │ │ │ └── circular-eager-relations │ │ │ │ ├── circular-eager-relations.ts │ │ │ │ └── entity │ │ │ │ ├── Post.ts │ │ │ │ ├── Profile.ts │ │ │ │ └── User.ts │ │ ├── lazy-relations │ │ │ ├── basic-lazy-relation │ │ │ │ ├── basic-lazy-relations.ts │ │ │ │ ├── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ └── Post.ts │ │ │ │ └── schema │ │ │ │ │ ├── profile.js │ │ │ │ │ └── user.js │ │ │ ├── named-columns │ │ │ │ ├── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ └── Post.ts │ │ │ │ └── named-columns-lazy-relations.ts │ │ │ ├── named-tables-and-columns │ │ │ │ ├── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ └── Post.ts │ │ │ │ └── named-tables-and-columns-lazy-relations.ts │ │ │ └── named-tables │ │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ │ └── named-tables-lazy-relations.ts │ │ ├── multiple-primary-keys │ │ │ ├── multiple-primary-keys-many-to-many │ │ │ │ ├── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ ├── Post.ts │ │ │ │ │ └── Tag.ts │ │ │ │ └── multiple-primary-keys-many-to-many.ts │ │ │ ├── multiple-primary-keys-many-to-one │ │ │ │ ├── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ └── Post.ts │ │ │ │ └── multiple-primary-keys-many-to-one.ts │ │ │ ├── multiple-primary-keys-one-to-one │ │ │ │ ├── entity │ │ │ │ │ ├── Category.ts │ │ │ │ │ ├── Post.ts │ │ │ │ │ └── Tag.ts │ │ │ │ └── multiple-primary-keys-one-to-one.ts │ │ │ └── multiple-primary-keys-other-cases │ │ │ │ ├── entity │ │ │ │ ├── Event.ts │ │ │ │ ├── EventMember.ts │ │ │ │ ├── Person.ts │ │ │ │ └── User.ts │ │ │ │ └── multiple-primary-keys-other-cases.ts │ │ ├── relation-mapped-to-different-name-column │ │ │ ├── entity │ │ │ │ ├── Post.ts │ │ │ │ └── PostDetails.ts │ │ │ └── relation-mapped-to-different-name-column.ts │ │ └── relation-with-primary-key │ │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ │ └── relation-with-primary-key.ts │ ├── repository │ │ ├── basic-methods │ │ │ ├── entity │ │ │ │ ├── Blog.ts │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ ├── model-schema │ │ │ │ └── QuestionSchema.ts │ │ │ ├── model │ │ │ │ ├── Question.ts │ │ │ │ └── User.ts │ │ │ ├── repository-basic-methods.ts │ │ │ └── schema │ │ │ │ └── user.js │ │ ├── clear │ │ │ ├── entity │ │ │ │ └── Post.ts │ │ │ └── repository-clear.ts │ │ ├── decrement │ │ │ ├── entity │ │ │ │ ├── Post.ts │ │ │ │ ├── PostBigInt.ts │ │ │ │ └── UserWithEmbededEntity.ts │ │ │ └── repository-decrement.ts │ │ ├── delete-by-id-and-ids │ │ │ ├── entity │ │ │ │ └── Post.ts │ │ │ └── repository-remove-by-id-and-ids.ts │ │ ├── find-methods │ │ │ ├── entity │ │ │ │ └── Post.ts │ │ │ ├── model │ │ │ │ └── User.ts │ │ │ ├── repostiory-find-methods.ts │ │ │ └── schema │ │ │ │ └── UserEntity.ts │ │ ├── find-options-locking │ │ │ ├── entity │ │ │ │ ├── PostWithUpdateDate.ts │ │ │ │ ├── PostWithVersion.ts │ │ │ │ ├── PostWithVersionAndUpdatedDate.ts │ │ │ │ └── PostWithoutVersionAndUpdateDate.ts │ │ │ └── find-options-locking.ts │ │ ├── find-options-operators │ │ │ ├── entity │ │ │ │ ├── PersonAR.ts │ │ │ │ └── Post.ts │ │ │ └── repository-find-operators.ts │ │ ├── find-options-relations │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Counters.ts │ │ │ │ ├── Photo.ts │ │ │ │ ├── Post.ts │ │ │ │ └── User.ts │ │ │ └── repository-find-options-relations.ts │ │ ├── find-options │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ ├── Photo.ts │ │ │ │ ├── Post.ts │ │ │ │ └── User.ts │ │ │ └── repository-find-options.ts │ │ ├── increment │ │ │ ├── entity │ │ │ │ ├── Post.ts │ │ │ │ ├── PostBigInt.ts │ │ │ │ └── UserWithEmbededEntity.ts │ │ │ └── repository-increment.ts │ │ └── set-add-remove-relations │ │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ │ └── repository-set-add-remove-relations.ts │ ├── schema-builder │ │ ├── add-column.ts │ │ ├── change-check-constraint.ts │ │ ├── change-column.ts │ │ ├── change-exclusion-constraint.ts │ │ ├── change-index.ts │ │ ├── change-unique-constraint.ts │ │ ├── create-foreign-key.ts │ │ ├── create-table.ts │ │ ├── custom-db-and-schema-sync.ts │ │ ├── drop-column.ts │ │ ├── entity │ │ │ ├── Album.ts │ │ │ ├── Category.ts │ │ │ ├── Faculty.ts │ │ │ ├── Photo.ts │ │ │ ├── Post.ts │ │ │ ├── PostVersion.ts │ │ │ ├── Question.ts │ │ │ ├── Student.ts │ │ │ └── Teacher.ts │ │ └── update-primary-keys.ts │ ├── spatial │ │ └── postgres │ │ │ ├── entity │ │ │ └── Post.ts │ │ │ └── spatial-postgres.ts │ ├── sqljs │ │ ├── auto-save.ts │ │ ├── entity │ │ │ └── Post.ts │ │ ├── load.ts │ │ ├── save.ts │ │ ├── sqlite │ │ │ └── test.sqlite │ │ └── startup.ts │ ├── table-inheritance │ │ ├── extending │ │ │ ├── entity │ │ │ │ ├── Content.ts │ │ │ │ ├── Post.ts │ │ │ │ └── Unit.ts │ │ │ └── extending-inheritance.ts │ │ └── single-table │ │ │ ├── basic-functionality │ │ │ ├── basic-functionality.ts │ │ │ └── entity │ │ │ │ ├── Accountant.ts │ │ │ │ ├── Employee.ts │ │ │ │ ├── Person.ts │ │ │ │ ├── Student.ts │ │ │ │ └── Teacher.ts │ │ │ ├── database-option-inherited │ │ │ ├── database-option-inherited.ts │ │ │ └── entity │ │ │ │ ├── Employee.ts │ │ │ │ └── Person.ts │ │ │ ├── non-virtual-discriminator-column │ │ │ ├── entity │ │ │ │ ├── Employee.ts │ │ │ │ ├── Person.ts │ │ │ │ └── Student.ts │ │ │ └── non-virtual-discriminator-column.ts │ │ │ └── relations │ │ │ ├── many-to-many │ │ │ ├── entity │ │ │ │ ├── Accountant.ts │ │ │ │ ├── Department.ts │ │ │ │ ├── Employee.ts │ │ │ │ ├── Faculty.ts │ │ │ │ ├── Person.ts │ │ │ │ ├── Specialization.ts │ │ │ │ ├── Student.ts │ │ │ │ └── Teacher.ts │ │ │ └── many-to-many.ts │ │ │ └── one-to-many │ │ │ ├── entity │ │ │ ├── Accountant.ts │ │ │ ├── Department.ts │ │ │ ├── Employee.ts │ │ │ ├── Faculty.ts │ │ │ ├── Person.ts │ │ │ ├── Specialization.ts │ │ │ ├── Student.ts │ │ │ └── Teacher.ts │ │ │ └── one-to-many.ts │ ├── transaction │ │ ├── database-specific-isolation │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ ├── full-isolation-support.ts │ │ │ ├── oracle-isolation.ts │ │ │ └── sqlite-isolation.ts │ │ ├── return-data-from-transaction │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ └── return-data-from-transaction.ts │ │ ├── single-query-runner │ │ │ ├── entity │ │ │ │ └── Post.ts │ │ │ ├── repository │ │ │ │ └── PostRepository.ts │ │ │ └── single-query-runner.ts │ │ ├── transaction-decorator │ │ │ ├── controller │ │ │ │ └── PostController.ts │ │ │ ├── entity │ │ │ │ ├── Category.ts │ │ │ │ └── Post.ts │ │ │ ├── repository │ │ │ │ └── CategoryRepository.ts │ │ │ └── transaction-decorator.ts │ │ └── transaction-in-entity-manager │ │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ │ └── transaction-in-entity-manager.ts │ ├── tree-tables │ │ ├── closure-table │ │ │ ├── closure-table.ts │ │ │ └── entity │ │ │ │ └── Category.ts │ │ ├── materialized-path │ │ │ ├── entity │ │ │ │ └── Category.ts │ │ │ └── materialized-path.ts │ │ └── nested-set │ │ │ ├── entity │ │ │ └── Category.ts │ │ │ └── nested-set.ts │ ├── uuid │ │ ├── cockroach │ │ │ ├── entity │ │ │ │ ├── Post.ts │ │ │ │ ├── Question.ts │ │ │ │ └── Record.ts │ │ │ └── uuid-cockroach.ts │ │ ├── mssql │ │ │ ├── entity │ │ │ │ ├── Post.ts │ │ │ │ └── Question.ts │ │ │ └── uuid-mssql.ts │ │ ├── mysql │ │ │ ├── entity │ │ │ │ ├── Post.ts │ │ │ │ └── Question.ts │ │ │ └── uuid-mysql.ts │ │ ├── oracle │ │ │ ├── entity │ │ │ │ ├── Post.ts │ │ │ │ └── Question.ts │ │ │ └── uuid-oracle.ts │ │ ├── postgres │ │ │ ├── entity │ │ │ │ ├── Post.ts │ │ │ │ ├── Question.ts │ │ │ │ └── Record.ts │ │ │ ├── pgcrypto.ts │ │ │ └── uuid-ossp.ts │ │ ├── sap │ │ │ ├── entity │ │ │ │ ├── Post.ts │ │ │ │ └── Question.ts │ │ │ └── uuid-sap.ts │ │ └── sqlite │ │ │ ├── entity │ │ │ ├── Post.ts │ │ │ └── Question.ts │ │ │ └── uuid-sqlite.ts │ └── view-entity │ │ ├── general │ │ ├── entity │ │ │ ├── Album.ts │ │ │ ├── Category.ts │ │ │ ├── Photo.ts │ │ │ ├── PhotoAlbumCategory.ts │ │ │ ├── Post.ts │ │ │ └── PostCategory.ts │ │ └── view-entity-general.ts │ │ ├── mssql │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── Post.ts │ │ │ └── PostCategory.ts │ │ └── view-entity-mssql.ts │ │ ├── mysql │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── Post.ts │ │ │ └── PostCategory.ts │ │ └── view-entity-mysql.ts │ │ ├── oracle │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── Post.ts │ │ │ └── PostCategory.ts │ │ └── view-entity-oracle.ts │ │ ├── postgres │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── Post.ts │ │ │ ├── PostByCategory.ts │ │ │ └── PostCategory.ts │ │ └── view-entity-postgres.ts │ │ └── sqlite │ │ ├── entity │ │ ├── Category.ts │ │ ├── Post.ts │ │ └── PostCategory.ts │ │ └── view-entity-sqlite.ts ├── github-issues │ ├── 47 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-47.ts │ ├── 56 │ │ ├── entity │ │ │ ├── AccessToken.ts │ │ │ └── User.ts │ │ └── issue-56.ts │ ├── 57 │ │ ├── entity │ │ │ ├── AccessToken.ts │ │ │ └── User.ts │ │ └── issue-57.ts │ ├── 58 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── Post.ts │ │ │ └── PostCategory.ts │ │ └── issue-58.ts │ ├── 70 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-70.ts │ ├── 71 │ │ ├── entity │ │ │ ├── Artikel.ts │ │ │ └── Kollektion.ts │ │ └── issue-71.ts │ ├── 80 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-80.ts │ ├── 85 │ │ ├── entity │ │ │ └── Document.ts │ │ └── issue-85.ts │ ├── 108 │ │ ├── entity │ │ │ ├── Project.ts │ │ │ └── User.ts │ │ └── issue-108.ts │ ├── 114 │ │ └── issue-114.ts │ ├── 131 │ │ ├── entity │ │ │ ├── Employee.ts │ │ │ ├── Person.ts │ │ │ └── Student.ts │ │ └── issue-131.ts │ ├── 134 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-134.ts │ ├── 151 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── Post.ts │ │ │ └── PostMetadata.ts │ │ └── issue-151.ts │ ├── 161 │ │ ├── entity │ │ │ ├── Request.ts │ │ │ └── Ticket.ts │ │ └── issue-161.ts │ ├── 163 │ │ ├── entity │ │ │ ├── Game.ts │ │ │ └── Platform.ts │ │ └── issue-163.ts │ ├── 174 │ │ ├── entity │ │ │ ├── Contact.ts │ │ │ └── Organisation.ts │ │ └── issue-174.ts │ ├── 175 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-175.ts │ ├── 176 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-176.ts │ ├── 182 │ │ ├── entity │ │ │ └── Post.ts │ │ ├── issue-182.ts │ │ └── model │ │ │ └── PostStatus.ts │ ├── 184 │ │ ├── entity │ │ │ ├── Employee.ts │ │ │ ├── Homesitter.ts │ │ │ ├── Person.ts │ │ │ └── Student.ts │ │ └── issue-184.ts │ ├── 190 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-190.ts │ ├── 197 │ │ ├── entity │ │ │ └── person.ts │ │ └── issue-197.ts │ ├── 204 │ │ ├── entity │ │ │ ├── Record.ts │ │ │ ├── RecordConfig.ts │ │ │ └── RecordData.ts │ │ └── issue-204.ts │ ├── 211 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-211.ts │ ├── 215 │ │ ├── entity │ │ │ ├── Abbreviation.ts │ │ │ ├── Author.ts │ │ │ └── Post.ts │ │ └── issue-215.ts │ ├── 219 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-219.ts │ ├── 234 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── Post.ts │ │ │ └── Tag.ts │ │ └── issue-234.ts │ ├── 300 │ │ ├── entity │ │ │ ├── Duration.ts │ │ │ └── Race.ts │ │ └── issue-300.ts │ ├── 306 │ │ ├── entity │ │ │ ├── Duration.ts │ │ │ └── Race.ts │ │ └── issue-306.ts │ ├── 320 │ │ ├── entity │ │ │ ├── ActivityEntity.ts │ │ │ └── TileEntity.ts │ │ └── issue-320.ts │ ├── 341 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-341.ts │ ├── 345 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-345.ts │ ├── 352 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-352.ts │ ├── 363 │ │ ├── entity │ │ │ ├── Car.ts │ │ │ └── Fruit.ts │ │ └── issue-363.ts │ ├── 388 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-388.ts │ ├── 401 │ │ ├── entity │ │ │ ├── Group.ts │ │ │ └── Player.ts │ │ └── issue-401.ts │ ├── 423 │ │ ├── entity │ │ │ └── Group.ts │ │ └── issue-423.ts │ ├── 433 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-433.ts │ ├── 438 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-438.ts │ ├── 463 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-463.ts │ ├── 479 │ │ ├── entity │ │ │ └── Car.ts │ │ └── issue-479.ts │ ├── 485 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-485.ts │ ├── 493 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-493.ts │ ├── 495 │ │ ├── entity │ │ │ ├── Item.ts │ │ │ └── User.ts │ │ └── issue-495.ts │ ├── 499 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-499.ts │ ├── 512 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-512.ts │ ├── 513 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-513.ts │ ├── 521 │ │ ├── entity │ │ │ └── Car.ts │ │ └── issue-521.ts │ ├── 587 │ │ ├── entity │ │ │ ├── Post.ts │ │ │ └── Tag.ts │ │ └── issue-587.ts │ ├── 594 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-594.ts │ ├── 609 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-609.ts │ ├── 620 │ │ ├── entity │ │ │ ├── Cat.ts │ │ │ └── Dog.ts │ │ └── issue-620.ts │ ├── 660 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-660.ts │ ├── 695 │ │ ├── entity │ │ │ ├── Device.ts │ │ │ └── DeviceInstance.ts │ │ └── issue-695.ts │ ├── 703 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-703.ts │ ├── 704 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-704.ts │ ├── 720 │ │ ├── entity │ │ │ ├── Locale.ts │ │ │ ├── Message.ts │ │ │ ├── Participant.ts │ │ │ └── Translation.ts │ │ └── issue-720.ts │ ├── 736 │ │ ├── entity │ │ │ └── Category.ts │ │ └── issue-736.ts │ ├── 750 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-750.ts │ ├── 752 │ │ ├── entity │ │ │ └── Product.ts │ │ └── issue-752.ts │ ├── 762 │ │ ├── entity │ │ │ ├── Foo.ts │ │ │ ├── FooChildMetadata.ts │ │ │ └── FooMetadata.ts │ │ └── issue-762.ts │ ├── 773 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-773.ts │ ├── 778 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── Post.ts │ │ │ └── Question.ts │ │ └── issue-778.ts │ ├── 798 │ │ └── issue-798.ts │ ├── 799 │ │ └── issue-799.ts │ ├── 807 │ │ ├── entity │ │ │ └── Tournament.ts │ │ └── issue-807.ts │ ├── 813 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-813.ts │ ├── 815 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-815.ts │ ├── 836 │ │ ├── entity │ │ │ ├── User.ts │ │ │ └── UserCredential.ts │ │ └── issue-836.ts │ ├── 838 │ │ ├── entity │ │ │ └── Flight.ts │ │ └── issue-838.ts │ ├── 863 │ │ ├── entities │ │ │ ├── detail.ts │ │ │ └── master.ts │ │ └── issue-863.ts │ ├── 867 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-867.ts │ ├── 904 │ │ ├── entity │ │ │ └── Category.ts │ │ └── issue-904.ts │ ├── 922 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-922.ts │ ├── 929 │ │ ├── entity │ │ │ └── TestEntity.ts │ │ └── issue-929.ts │ ├── 945 │ │ ├── entity │ │ │ └── TestEntity.ts │ │ └── issue-945.ts │ ├── 948 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-948.ts │ ├── 953 │ │ ├── entity │ │ │ └── user.ts │ │ └── issue-953.ts │ ├── 966 │ │ ├── entity │ │ │ └── user.ts │ │ └── issue-966.ts │ ├── 970 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-970.ts │ ├── 996 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-996.ts │ ├── 1014 │ │ ├── entity │ │ │ └── TestEntity.ts │ │ └── issue-1014.ts │ ├── 1034 │ │ ├── entity │ │ │ ├── Circle.ts │ │ │ └── User.ts │ │ └── issue-1034.ts │ ├── 1042 │ │ ├── entity │ │ │ ├── Information.ts │ │ │ ├── Profile.ts │ │ │ └── User.ts │ │ └── issue-1042.ts │ ├── 1055 │ │ ├── entity │ │ │ ├── Child.ts │ │ │ └── Parent.ts │ │ └── issue-1055.ts │ ├── 1089 │ │ ├── entity │ │ │ └── Group.ts │ │ └── issue-1089.ts │ ├── 1099 │ │ ├── entity │ │ │ ├── Animal.ts │ │ │ └── Category.ts │ │ └── issue-1099.ts │ ├── 1113 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1113.ts │ ├── 1118 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1118.ts │ ├── 1123 │ │ ├── entity │ │ │ ├── Author.ts │ │ │ └── Post.ts │ │ └── issue-1123.ts │ ├── 1139 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-1139.ts │ ├── 1140 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1140.ts │ ├── 1147 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1147.ts │ ├── 1178 │ │ ├── entity │ │ │ ├── Post.ts │ │ │ └── User.ts │ │ └── issue-1178.ts │ ├── 1210 │ │ ├── entity │ │ │ ├── Event.ts │ │ │ └── User.ts │ │ └── issue-1210.ts │ ├── 1233 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1233.ts │ ├── 1245 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1245.ts │ ├── 1259 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-1259.ts │ ├── 1261 │ │ ├── entity │ │ │ ├── Bar.ts │ │ │ └── Foo.ts │ │ └── issue-1261.ts │ ├── 1282 │ │ ├── entity │ │ │ ├── Animal.ts │ │ │ └── Category.ts │ │ ├── issue-1282.ts │ │ └── naming │ │ │ └── NamingStrategyUnderTest.ts │ ├── 1308 │ │ ├── entity │ │ │ ├── Author.ts │ │ │ └── Post.ts │ │ └── issue-1308.ts │ ├── 1314 │ │ ├── entity │ │ │ └── Record.ts │ │ └── issue-1314.ts │ ├── 1326 │ │ ├── entity │ │ │ ├── SpecificUser.ts │ │ │ └── User.ts │ │ └── issue-1326.ts │ ├── 1369 │ │ ├── entity │ │ │ ├── AbstractEntity.ts │ │ │ └── ConcreteEntity.ts │ │ ├── issue-1369.ts │ │ └── subscriber │ │ │ └── AbstractEntitySubscriber.ts │ ├── 1377 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1377.ts │ ├── 1388 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1388.ts │ ├── 1397 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1397.ts │ ├── 1416 │ │ ├── entity │ │ │ ├── Author.ts │ │ │ ├── Photo.ts │ │ │ └── PhotoMetadata.ts │ │ └── issue-1416.ts │ ├── 1427 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1427.ts │ ├── 1465 │ │ ├── entity │ │ │ ├── Account.ts │ │ │ ├── AccountActivationToken.ts │ │ │ └── Token.ts │ │ └── save-relation.ts │ ├── 1476 │ │ ├── entity │ │ │ ├── Item.ts │ │ │ └── Plan.ts │ │ └── issue-1476.ts │ ├── 1493 │ │ └── issue-1493.ts │ ├── 1504 │ │ ├── entity │ │ │ ├── TestEntity1.ts │ │ │ ├── TestEntity2.ts │ │ │ ├── TestEntity3.ts │ │ │ └── TestEntity4.ts │ │ └── issue-1504.ts │ ├── 1510 │ │ └── issue-1510.ts │ ├── 1545 │ │ ├── entity │ │ │ ├── DataModel.ts │ │ │ ├── MainModel.ts │ │ │ └── ValidationModel.ts │ │ └── issue-1545.ts │ ├── 1551 │ │ ├── entity │ │ │ ├── Chat.ts │ │ │ ├── Message.ts │ │ │ ├── Recipient.ts │ │ │ └── User.ts │ │ └── issue-1551.ts │ ├── 1569 │ │ ├── entity │ │ │ └── Item.ts │ │ └── issue-1569.ts │ ├── 1576 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-1576.ts │ ├── 1581 │ │ ├── entity │ │ │ ├── DeliverySlot.ts │ │ │ ├── Order.ts │ │ │ ├── OrderItem.ts │ │ │ ├── Product.ts │ │ │ └── User.ts │ │ └── issue-1581.ts │ ├── 1584 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-1584.ts │ ├── 1591 │ │ ├── entity │ │ │ ├── Photo.ts │ │ │ └── User.ts │ │ └── issue-1591.ts │ ├── 1600 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-1600.ts │ ├── 1615 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1615.ts │ ├── 1623 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-1623.ts │ ├── 1652 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1652.ts │ ├── 1656 │ │ ├── controller │ │ │ └── Controller.ts │ │ ├── entity │ │ │ ├── A.ts │ │ │ ├── B.ts │ │ │ └── C.ts │ │ └── issue-1656.ts │ ├── 1680 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-1680.ts │ ├── 1685 │ │ ├── entity │ │ │ ├── month.ts │ │ │ ├── user-month.ts │ │ │ ├── user.ts │ │ │ └── year.ts │ │ └── issue-1685.ts │ ├── 1703 │ │ ├── entity │ │ │ ├── OrganizationEntity.ts │ │ │ ├── UserEntity.ts │ │ │ └── UserToOrganizationEntity.ts │ │ └── issue-1703.ts │ ├── 1716 │ │ ├── entity │ │ │ ├── mariadbEntity.ts │ │ │ ├── mssqlEntity.ts │ │ │ ├── mysqlEntity.ts │ │ │ ├── pgEntity.ts │ │ │ └── postgresEntity.ts │ │ └── issue-1716.ts │ ├── 1720 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-1720.ts │ ├── 1733 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1733.ts │ ├── 1748 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1748.ts │ ├── 1749 │ │ ├── entity │ │ │ └── Bar.ts │ │ └── issue-1749.ts │ ├── 1751 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-1751.ts │ ├── 1754 │ │ ├── entity │ │ │ ├── cliente.ts │ │ │ └── tipo-cliente.ts │ │ └── issue-1754.ts │ ├── 1758 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1758.ts │ ├── 1780 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-1780.ts │ ├── 1788 │ │ ├── entity │ │ │ ├── Personalization.ts │ │ │ └── Provider.ts │ │ └── issue-1788.ts │ ├── 1805 │ │ ├── entity │ │ │ └── Account.ts │ │ └── issue-1805.ts │ ├── 1825 │ │ ├── entity │ │ │ └── thing.ts │ │ └── issue-1825.ts │ ├── 1839 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-1839.ts │ ├── 1863 │ │ └── issue-1863.ts │ ├── 1883 │ │ ├── entity │ │ │ └── Post.ts │ │ ├── enum │ │ │ └── FruitEnum.ts │ │ └── issue-1883.ts │ ├── 1887 │ │ ├── entity │ │ │ └── Error.ts │ │ └── issue-1887.ts │ ├── 1898 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1898.ts │ ├── 1901 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1901.ts │ ├── 1909 │ │ └── issue-1909.ts │ ├── 1926 │ │ ├── entity │ │ │ ├── Event.ts │ │ │ ├── EventRole.ts │ │ │ └── Role.ts │ │ └── issue-1926.ts │ ├── 1929 │ │ ├── entity │ │ │ └── Product.ts │ │ └── issue-1929.ts │ ├── 1960 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-1960.ts │ ├── 1972 │ │ ├── entity │ │ │ ├── TournamentParticipant.ts │ │ │ ├── TournamentSquadParticipant.ts │ │ │ ├── TournamentUserParticipant.ts │ │ │ └── User.ts │ │ └── issue-1972.ts │ ├── 1981 │ │ ├── entity │ │ │ └── Product.ts │ │ └── issue-1981.ts │ ├── 1997 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-1997.ts │ ├── 2005 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-2005.ts │ ├── 2006 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-2006.ts │ ├── 2031 │ │ ├── entity │ │ │ ├── Photo.ts │ │ │ └── User.ts │ │ └── issue-2031.ts │ ├── 2044 │ │ ├── entity │ │ │ ├── Photo.ts │ │ │ └── User.ts │ │ └── issue-2044.ts │ ├── 2067 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-2067.ts │ ├── 2103 │ │ ├── entity │ │ │ ├── Complex.ts │ │ │ └── Simple.ts │ │ └── issue-2103.ts │ ├── 2128 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-2128.ts │ ├── 2147 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-2147.ts │ ├── 2199 │ │ ├── entity │ │ │ └── Bar.ts │ │ └── issue-2199.ts │ ├── 2200 │ │ ├── entity │ │ │ ├── Booking.ts │ │ │ └── Contact.ts │ │ ├── issue-2200.ts │ │ └── naming │ │ │ └── NamingStrategyUnderTest.ts │ ├── 2201 │ │ ├── entity │ │ │ ├── ver1 │ │ │ │ ├── context.ts │ │ │ │ ├── record.ts │ │ │ │ └── user.ts │ │ │ └── ver2 │ │ │ │ ├── context.ts │ │ │ │ ├── record.ts │ │ │ │ └── user.ts │ │ └── issue-2201.ts │ ├── 2251 │ │ ├── entity │ │ │ ├── Bar.ts │ │ │ └── Foo.ts │ │ └── issue-2251.ts │ ├── 2253 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-2253.ts │ ├── 2259 │ │ └── issue-2259.ts │ ├── 2287 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-2287.ts │ ├── 2313 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-2313.ts │ ├── 2364 │ │ ├── entity │ │ │ ├── dummy.ts │ │ │ └── dummy2.ts │ │ └── issue-2364.ts │ ├── 2464 │ │ ├── entity │ │ │ ├── Bar.ts │ │ │ └── Foo.ts │ │ └── issue-2464.ts │ ├── 2499 │ │ ├── entity │ │ │ └── Foo.ts │ │ └── issue-2499.ts │ ├── 2518 │ │ ├── entity │ │ │ └── file.entity.ts │ │ └── issue-2518.ts │ ├── 2557 │ │ ├── entity │ │ │ └── dummy.ts │ │ ├── issue-2557.ts │ │ └── transformer.ts │ ├── 2632 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-2632.ts │ ├── 2693 │ │ ├── entity │ │ │ └── user.ts │ │ ├── issue-2693.ts │ │ └── migration │ │ │ ├── 0000000000001-CreateUuidExtension.ts │ │ │ ├── 0000000000002-CreateUsers.ts │ │ │ └── 0000000000003-InsertUser.ts │ ├── 2733 │ │ ├── entity │ │ │ ├── MSSQLDummy.ts │ │ │ └── PostgresDummy.ts │ │ └── issue-2733.ts │ ├── 2737 │ │ ├── entity │ │ │ └── TestEntity.ts │ │ └── issue-2737.ts │ ├── 2779 │ │ ├── entity │ │ │ └── Post.ts │ │ ├── issue-2779.ts │ │ └── set.ts │ ├── 2800 │ │ ├── entity │ │ │ ├── Car.ts │ │ │ ├── Plane.ts │ │ │ └── Vehicle.ts │ │ └── issue-2800.ts │ ├── 2871 │ │ ├── documentEnum.ts │ │ ├── entity │ │ │ └── Bar.ts │ │ ├── enumTools.ts │ │ └── issue-2871.ts │ ├── 2875 │ │ ├── issue-2875.ts │ │ └── migration │ │ │ └── 1530542855524-CreateUsersSeq.ts │ ├── 2965 │ │ ├── entity │ │ │ ├── note.ts │ │ │ └── person.ts │ │ └── index.ts │ ├── 3047 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-3047.ts │ ├── 3112 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-3112.ts │ ├── 3118 │ │ ├── entity │ │ │ ├── AuthorWithVeryLongName.ts │ │ │ ├── CategoryWithVeryLongName.ts │ │ │ ├── GroupWithVeryLongName.ts │ │ │ └── PostWithVeryLongName.ts │ │ └── issue-3118.ts │ ├── 3142 │ │ ├── entity │ │ │ ├── Contact.ts │ │ │ └── Person.ts │ │ └── issue-3142.ts │ ├── 3151 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Note.ts │ │ └── issue-3151.ts │ ├── 3158 │ │ ├── entity │ │ │ ├── Session.ts │ │ │ └── SessionSettings.ts │ │ └── issue-3158.ts │ ├── 3256 │ │ ├── entity │ │ │ └── Post.ts │ │ ├── issue-3256.ts │ │ └── subscriber │ │ │ └── PostSubscriber.ts │ ├── 3349 │ │ ├── entity │ │ │ └── Category.ts │ │ └── issue-3349.ts │ ├── 3350 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-3350.ts │ ├── 3352 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-3352.ts │ ├── 3363 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── issue-3363.ts │ ├── 3374 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-3374.ts │ ├── 3379 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-3379.ts │ ├── 3395 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-3395.ts │ ├── 3422 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-3422.ts │ ├── 3496 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-3496.ts │ ├── 3536 │ │ ├── entity │ │ │ └── Roles.ts │ │ └── issue-3536.ts │ ├── 3551 │ │ ├── entity │ │ │ └── Book.ts │ │ └── issue-3551.ts │ ├── 3587 │ │ ├── entity │ │ │ └── EquipmentModel.ts │ │ └── issue-3587.ts │ ├── 3588 │ │ ├── entity │ │ │ └── mysql.ts │ │ └── issue-3588.ts │ ├── 3604 │ │ ├── entity │ │ │ ├── Author.ts │ │ │ └── Post.ts │ │ └── issue-3604.ts │ ├── 3654 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-3654.ts │ ├── 3694 │ │ ├── entity │ │ │ └── Post.ts │ │ ├── enum │ │ │ └── FruitEnum.ts │ │ └── issue-3694.ts │ ├── 3702 │ │ ├── entity │ │ │ └── LetterBox.ts │ │ └── issue-3702.ts │ ├── 3737 │ │ └── issue-3737.ts │ ├── 3783 │ │ ├── entity │ │ │ └── Category.ts │ │ └── issue-3783.ts │ ├── 3803 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-3803.ts │ ├── 3828 │ │ ├── entity │ │ │ └── Entity.ts │ │ └── issue-3828.ts │ ├── 3847 │ │ ├── entity │ │ │ ├── Animal.ts │ │ │ └── Category.ts │ │ ├── issue-3847.ts │ │ └── naming │ │ │ └── NamingStrategyUnderTest.ts │ ├── 3857 │ │ ├── entity │ │ │ ├── Men.ts │ │ │ ├── Person.ts │ │ │ └── Women.ts │ │ └── issue-3857.ts │ ├── 3946 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── Image.ts │ │ │ └── Post.ts │ │ └── issue-3946.ts │ ├── 3949 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-3949.ts │ ├── 4096 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-4096.ts │ ├── 4106 │ │ ├── entity │ │ │ ├── Animal.ts │ │ │ ├── GenderEnum.ts │ │ │ └── Human.ts │ │ └── issue-4106.ts │ ├── 4156 │ │ ├── entity │ │ │ ├── Author.ts │ │ │ └── Post.ts │ │ └── issue-4156.ts │ ├── 4185 │ │ ├── entity │ │ │ └── Post.ts │ │ ├── issue-4185.ts │ │ └── subscriber │ │ │ ├── ExtendedAfterLoadSubscriber.ts │ │ │ └── SimpleAfterLoadSubscriber.ts │ ├── 4190 │ │ ├── entity │ │ │ ├── Category.ts │ │ │ ├── Photo.ts │ │ │ ├── Profile.ts │ │ │ ├── Question.ts │ │ │ └── User.ts │ │ └── issue-4190.ts │ ├── 4219 │ │ ├── entity │ │ │ ├── Photo.ts │ │ │ └── User.ts │ │ ├── issue-4219.ts │ │ └── shim.ts │ ├── 4220 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-4220.ts │ ├── 4440 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-4440.ts │ ├── 4513 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-4513.ts │ ├── 4570 │ │ └── issue-4570.ts │ ├── 4630 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-4630.ts │ ├── 4697 │ │ ├── entity │ │ │ ├── config.entity.ts │ │ │ └── item.entity.ts │ │ ├── issue-4697.ts │ │ └── migration │ │ │ ├── 1566560354098-UpdateContacts.ts │ │ │ └── 1567689639607-MergeConfigs.ts │ ├── 4701 │ │ ├── issue-4701.ts │ │ └── migration │ │ │ ├── 1567759789051-ExampleMigration.ts │ │ │ ├── 1567759832591-ExampleMigrationTwo.ts │ │ │ └── 1571426391120-ExampleMigrationThree.ts │ ├── 4719 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-4719.ts │ ├── 4753 │ │ ├── entity │ │ │ └── User.ts │ │ └── issue-4753.ts │ ├── 4782 │ │ ├── entity │ │ │ └── Item.ts │ │ └── issue-4782.ts │ ├── 4842 │ │ ├── entity │ │ │ └── Post.ts │ │ └── issue-4842.ts │ ├── 5004 │ │ ├── entity │ │ │ └── Foo.ts │ │ └── issue-5004.ts │ └── 5174 │ │ ├── entity │ │ ├── Role.ts │ │ └── User.ts │ │ └── issue-5174.ts ├── integration │ ├── sample1-simple-entity.ts │ ├── sample2-one-to-one.ts │ ├── sample3-many-to-one.ts │ └── sample4-many-to-many.ts ├── other-issues │ ├── column-getters │ │ ├── column-getters.ts │ │ └── entity │ │ │ └── Post.ts │ ├── ekifox-increment-issue │ │ ├── ekifox-increment-issue.ts │ │ └── entity │ │ │ └── User.ts │ ├── entity-change-in-listeners │ │ ├── entity-change-in-listeners.ts │ │ └── entity │ │ │ └── Post.ts │ ├── entity-change-in-subscribers │ │ ├── entity-change-in-subscribers.ts │ │ ├── entity │ │ │ ├── Post.ts │ │ │ └── PostCategory.ts │ │ └── subscriber │ │ │ └── PostSubscriber.ts │ ├── escaping-function-parameter │ │ ├── entity │ │ │ └── Post.ts │ │ └── escaping-function-parameter.ts │ ├── hydrate-performance │ │ ├── entity │ │ │ └── Post.ts │ │ └── hydrate-performance.ts │ ├── inheritance-duplicate-columns │ │ ├── entity │ │ │ ├── BaseContent.ts │ │ │ ├── BasePost.ts │ │ │ └── Post.ts │ │ └── inheritance-duplicate-columns.ts │ ├── join-empty-relations │ │ ├── entity │ │ │ ├── Author.ts │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── join-empty-relations.ts │ ├── limit-with-order-by │ │ ├── entity │ │ │ ├── Category.ts │ │ │ └── Post.ts │ │ └── limit-with-order-by.ts │ ├── mongodb-entity-change-in-listeners │ │ ├── entity │ │ │ └── Post.ts │ │ └── mongodb-entity-change-in-listeners.ts │ ├── mongodb-entity-change-in-subscribers │ │ ├── entity │ │ │ └── Post.ts │ │ ├── mongodb-entity-change-in-subscribers.ts │ │ └── subscriber │ │ │ └── PostSubscriber.ts │ ├── mssql-add-column-with-default-value │ │ ├── entity │ │ │ ├── Post-Fail.ts │ │ │ ├── Post-Succeed.ts │ │ │ └── Post.ts │ │ └── mssql-add-column-with-default-value.ts │ ├── nested-child-entities │ │ ├── entity │ │ │ ├── BilliardsTournament.ts │ │ │ ├── SquadBilliardsTournament.ts │ │ │ ├── Tournament.ts │ │ │ └── TournamentGraph.ts │ │ └── nested-child-entities.ts │ ├── preventing-injection │ │ ├── entity │ │ │ └── Post.ts │ │ └── preventing-injection.ts │ ├── take-multiple-pk │ │ ├── entity │ │ │ ├── Role.ts │ │ │ └── User.ts │ │ └── take-multiple-pk.ts │ └── update-relational-column-on-relation-change │ │ ├── entity │ │ ├── Category.ts │ │ └── Post.ts │ │ └── update-relational-column-on-relation-change.ts └── utils │ ├── test-setup.ts │ └── test-utils.ts ├── tsconfig.json ├── tslint.json └── vendor └── https └── deno.land ├── std ├── async │ └── deferred.ts ├── encoding │ ├── utf8.ts │ └── yaml.ts ├── fmt │ └── colors.ts ├── fs │ ├── empty_dir.ts │ ├── ensure_dir.ts │ ├── exists.ts │ └── expand_glob.ts ├── hash │ └── sha256.ts ├── node │ └── process.ts └── path │ └── mod.ts └── x ├── dotenv └── mod.ts ├── mysql └── mod.ts ├── postgres └── mod.ts ├── sqlite └── mod.ts └── yargs ├── deno-types.ts └── deno.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | charset = utf-8 12 | indent_style = space 13 | indent_size = 4 14 | 15 | # Matches the exact files either *.json or *.yml 16 | [*.{json,yml}] 17 | indent_style = space 18 | indent_size = 2 19 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: typeorm 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | custom: # Replace with a single custom sponsorship URL 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .nyc_output/ 2 | .DS_Store 3 | .idea/ 4 | build/ 5 | coverage/ 6 | node_modules/ 7 | ormconfig.json 8 | ormlogs.log 9 | npm-debug.log 10 | /test/github-issues/799/tmp/* 11 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "deno.enable": true 3 | } 4 | -------------------------------------------------------------------------------- /cli.ts: -------------------------------------------------------------------------------- 1 | import "./src/cli.ts"; 2 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | precision: 2 3 | round: down 4 | range: "40...80" 5 | 6 | comment: off 7 | -------------------------------------------------------------------------------- /docker/hana/hxe-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "master_password" : "HXEHana1" 3 | } 4 | -------------------------------------------------------------------------------- /docs/entity-metadata.md: -------------------------------------------------------------------------------- 1 | # Entity Metadata 2 | 3 | Entity metadata and all related metadata classes contain information about entities, 4 | their columns, indices, relations and other entity-related information you can use 5 | to create more complex applications or extensions for TypeORM. 6 | 7 | TBD. -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | 3 | This directory contains all TypeORM documentation. 4 | This documentation is represented on a site. -------------------------------------------------------------------------------- /docs/internals.md: -------------------------------------------------------------------------------- 1 | # Internals 2 | 3 | This guide explains how things are working in TypeORM. 4 | It will be useful for our contributors. 5 | 6 | TBD. -------------------------------------------------------------------------------- /docs/query-runner.md: -------------------------------------------------------------------------------- 1 | # Query Runner 2 | 3 | `QueryRunner` is used to perform database-related queries. 4 | 5 | TBD. -------------------------------------------------------------------------------- /docs/zh_CN/changelog.md: -------------------------------------------------------------------------------- 1 | # 更新日志 2 | -------------------------------------------------------------------------------- /docs/zh_CN/delete-query-builder.md: -------------------------------------------------------------------------------- 1 | # 使用 Query Builder 删除 2 | 3 | 你可以使用`QueryBuilder`创建`DELETE`查询。 4 | 例如: 5 | 6 | ```typescript 7 | import { getConnection } from "typeorm"; 8 | 9 | await getConnection() 10 | .createQueryBuilder() 11 | .delete() 12 | .from(User) 13 | .where("id = :id", { id: 1 }) 14 | .execute(); 15 | ``` 16 | 17 | 就性能而言,这是删除数据库中的实体的最有效方法。 18 | -------------------------------------------------------------------------------- /docs/zh_CN/entity-metadata.md: -------------------------------------------------------------------------------- 1 | # 实体元数据 2 | 3 | 实体元数据和所有相关元数据类包含有关实体,其列、索引、关系以及可用于为TypeORM创建更复杂的应用程序或扩展的其他实体相关信息的信息。 4 | 5 | 待定。 6 | -------------------------------------------------------------------------------- /docs/zh_CN/internals.md: -------------------------------------------------------------------------------- 1 | # Internals 2 | 3 | 本指南解释了TypeORM中的工作原理。 4 | 这对我们的贡献者很有用。 5 | 6 | 待定。 7 | -------------------------------------------------------------------------------- /docs/zh_CN/query-runner.md: -------------------------------------------------------------------------------- 1 | # Query Runner 2 | 3 | `QueryRunner`用于执行与数据库相关的查询。 4 | 5 | 待定 6 | -------------------------------------------------------------------------------- /mod.ts: -------------------------------------------------------------------------------- 1 | export * from "./src/index.ts"; 2 | -------------------------------------------------------------------------------- /resources/logo_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denolib/typeorm/5024967ef8797627f3fcc8a975df52fc92192c2c/resources/logo_big.png -------------------------------------------------------------------------------- /sample/sample10-mixed/entity/Chapter.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, OneToMany, PrimaryGeneratedColumn} from "../../../src/index"; 2 | import {PostDetails} from "./PostDetails"; 3 | 4 | @Entity("sample10_chapter") 5 | export class Chapter { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column() 11 | about: string; 12 | 13 | @OneToMany(type => PostDetails, postDetails => postDetails.chapter) 14 | postDetails: PostDetails[]; 15 | 16 | } -------------------------------------------------------------------------------- /sample/sample10-mixed/entity/Cover.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, OneToMany, PrimaryGeneratedColumn} from "../../../src/index"; 2 | import {Post} from "./Post"; 3 | 4 | @Entity("sample10_cover") 5 | export class Cover { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column() 11 | url: string; 12 | 13 | @OneToMany(type => Post, post => post.cover) 14 | posts: Post[]; 15 | 16 | } -------------------------------------------------------------------------------- /sample/sample10-mixed/entity/ImageDetails.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, OneToOne, PrimaryGeneratedColumn} from "../../../src/index"; 2 | import {Image} from "./Image"; 3 | 4 | @Entity("sample10_image_details") 5 | export class ImageDetails { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column() 11 | meta: string; 12 | 13 | @Column() 14 | comment: string; 15 | 16 | @OneToOne(type => Image, image => image.details) 17 | image: Image; 18 | 19 | } -------------------------------------------------------------------------------- /sample/sample12-custom-naming-strategy/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity("sample1_post") 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column() 10 | title: string; 11 | 12 | @Column() 13 | text: string; 14 | 15 | @Column() 16 | likesCount: number; 17 | 18 | } -------------------------------------------------------------------------------- /sample/sample13-everywhere-abstraction/entity/BasePost.ts: -------------------------------------------------------------------------------- 1 | import {Column, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | export class BasePost { 4 | 5 | @PrimaryGeneratedColumn() 6 | id: number; 7 | 8 | @Column() 9 | title: string; 10 | 11 | @Column() 12 | title2312312: string; 13 | 14 | } -------------------------------------------------------------------------------- /sample/sample13-everywhere-abstraction/entity/PostUser.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity("sample13_post_user") 4 | export class PostUser { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column("int") 10 | name: string; 11 | 12 | @Column() 13 | firstName: string; 14 | 15 | @Column() 16 | secondName: string; 17 | 18 | } -------------------------------------------------------------------------------- /sample/sample16-indexes/entity/BasePost.ts: -------------------------------------------------------------------------------- 1 | import {Column, PrimaryGeneratedColumn} from "../../../src/index"; 2 | import {Index} from "../../../src/decorator/Index"; 3 | 4 | @Index("my_index_with_id_and_text", ["id", "text"]) 5 | export class BasePost { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column({ unique: true }) 11 | text: string; 12 | 13 | @Index() 14 | @Column() 15 | extra: string; 16 | 17 | } -------------------------------------------------------------------------------- /sample/sample17-versioning/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | import {VersionColumn} from "../../../src/decorator/columns/VersionColumn"; 3 | 4 | @Entity("sample17_post") 5 | export class Post { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column() 11 | title: string; 12 | 13 | @Column() 14 | text: string; 15 | 16 | @VersionColumn() 17 | version: number; 18 | 19 | } -------------------------------------------------------------------------------- /sample/sample19-one-side-relations/entity/Author.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity("sample19_author") 4 | export class Author { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column() 10 | name: string; 11 | 12 | } -------------------------------------------------------------------------------- /sample/sample19-one-side-relations/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity("sample19_category") 4 | export class Category { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column() 10 | name: string; 11 | 12 | } -------------------------------------------------------------------------------- /sample/sample19-one-side-relations/entity/PostMetadata.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity("sample19_post_metadata") 4 | export class PostMetadata { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column("text") 10 | comment: string; 11 | 12 | } -------------------------------------------------------------------------------- /sample/sample2-one-to-one/entity/PostAuthor.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, OneToOne, PrimaryGeneratedColumn} from "../../../src/index.ts"; 2 | import {Post} from "./Post.ts"; 3 | 4 | @Entity("sample2_post_author") 5 | export class PostAuthor { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column({ type: String }) 11 | name: string; 12 | 13 | @OneToOne(type => Post, post => post.author) 14 | post: Post; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sample/sample2-one-to-one/entity/PostCategory.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index.ts"; 2 | 3 | @Entity("sample2_post_category") 4 | export class PostCategory { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column({ type: String }) 10 | name: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /sample/sample2-one-to-one/entity/PostImage.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, OneToOne, PrimaryGeneratedColumn} from "../../../src/index.ts"; 2 | import {Post} from "./Post.ts"; 3 | 4 | @Entity("sample2_post_image") 5 | export class PostImage { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column({ type: String }) 11 | url: string; 12 | 13 | @OneToOne(type => Post, post => post.image) 14 | post: Post; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sample/sample2-one-to-one/entity/PostMetadata.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, OneToOne, PrimaryGeneratedColumn} from "../../../src/index.ts"; 2 | import {Post} from "./Post.ts"; 3 | 4 | @Entity("sample2_post_metadata") 5 | export class PostMetadata { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column({ type: String }) 11 | description: string; 12 | 13 | @OneToOne(type => Post, post => post.metadata) 14 | post: Post; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sample/sample20-join-without-relation/entity/Author.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity("sample20_author") 4 | export class Author { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column() 10 | name: string; 11 | 12 | } -------------------------------------------------------------------------------- /sample/sample20-join-without-relation/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity("sample20_category") 4 | export class Category { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column() 10 | name: string; 11 | 12 | } -------------------------------------------------------------------------------- /sample/sample23-nested-joins/entity/Author.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity("sample23_author") 4 | export class Author { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column() 10 | name: string; 11 | 12 | } -------------------------------------------------------------------------------- /sample/sample24-schemas/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Post} from "./Post"; 2 | 3 | export interface Category { 4 | 5 | id?: number; 6 | description: string; 7 | posts?: Post[]; 8 | 9 | } -------------------------------------------------------------------------------- /sample/sample24-schemas/entity/Image.ts: -------------------------------------------------------------------------------- 1 | import {Post} from "./Post"; 2 | 3 | export interface Image { 4 | 5 | id?: number; 6 | name: string; 7 | url: string; 8 | post?: Post; 9 | secondaryPost?: Post; 10 | 11 | } -------------------------------------------------------------------------------- /sample/sample24-schemas/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Image} from "./Image"; 2 | import {Category} from "./Category"; 3 | import {PostDetails} from "./PostDetails"; 4 | 5 | export interface Post { 6 | 7 | id?: number; 8 | title: string; 9 | text: string; 10 | details?: PostDetails; 11 | images?: Image[]; 12 | secondaryImages?: Image[]; 13 | categories?: Category[]; 14 | 15 | } -------------------------------------------------------------------------------- /sample/sample24-schemas/entity/PostDetails.ts: -------------------------------------------------------------------------------- 1 | import {Post} from "./Post"; 2 | 3 | export interface PostDetails { 4 | 5 | id?: number; 6 | metadata: string; 7 | comment: string; 8 | post?: Post; 9 | 10 | } -------------------------------------------------------------------------------- /sample/sample26-embedded-tables/entity/Counters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../src/index"; 2 | 3 | export class Counters { 4 | 5 | @Column() 6 | raiting: number; 7 | 8 | @Column() 9 | stars: number; 10 | 11 | @Column() 12 | commentCount: number; 13 | 14 | @Column() 15 | metadata: string; 16 | 17 | } -------------------------------------------------------------------------------- /sample/sample26-embedded-tables/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | import {Counters} from "./Counters"; 3 | 4 | @Entity("sample26_post") 5 | export class Post { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column() 11 | title: string; 12 | 13 | @Column() 14 | text: string; 15 | 16 | @Column(type => Counters) 17 | counters: Counters; 18 | 19 | } -------------------------------------------------------------------------------- /sample/sample26-embedded-tables/entity/Question.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | import {Counters} from "./Counters"; 3 | 4 | @Entity("sample26_question") 5 | export class Question { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column() 11 | title: string; 12 | 13 | @Column(type => Counters) 14 | counters: Counters; 15 | 16 | } -------------------------------------------------------------------------------- /sample/sample27-composite-primary-keys/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity} from "../../../src/index"; 2 | import {PrimaryColumn} from "../../../src/decorator/columns/PrimaryColumn"; 3 | 4 | @Entity("sample27_composite_primary_keys") 5 | export class Post { 6 | 7 | @PrimaryColumn("int") 8 | id: number; 9 | 10 | @PrimaryColumn() 11 | type: string; 12 | 13 | @Column() 14 | text: string; 15 | 16 | } -------------------------------------------------------------------------------- /sample/sample28-single-table-inheritance/entity/Employee.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../src/decorator/columns/Column"; 2 | import {Person} from "./Person"; 3 | import {ChildEntity} from "../../../src/decorator/entity/ChildEntity"; 4 | 5 | @ChildEntity() 6 | export class Employee extends Person { 7 | 8 | @Column() 9 | salary: number; 10 | 11 | } -------------------------------------------------------------------------------- /sample/sample28-single-table-inheritance/entity/Homesitter.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../src/decorator/columns/Column"; 2 | import {Person} from "./Person"; 3 | import {ChildEntity} from "../../../src/decorator/entity/ChildEntity"; 4 | 5 | @ChildEntity("home-sitter") 6 | export class Homesitter extends Person { 7 | 8 | @Column() 9 | numberOfKids: number; 10 | 11 | } -------------------------------------------------------------------------------- /sample/sample28-single-table-inheritance/entity/Student.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../src/decorator/columns/Column"; 2 | import {Person} from "./Person"; 3 | import {ChildEntity} from "../../../src/decorator/entity/ChildEntity"; 4 | 5 | @ChildEntity() 6 | export class Student extends Person { 7 | 8 | @Column() 9 | faculty: string; 10 | 11 | } -------------------------------------------------------------------------------- /sample/sample3-many-to-one/entity/PostAuthor.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, OneToMany, PrimaryGeneratedColumn} from "../../../src/index.ts"; 2 | import {Post} from "./Post.ts"; 3 | 4 | @Entity("sample3_post_author") 5 | export class PostAuthor { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column({ type: String }) 11 | name: string; 12 | 13 | @OneToMany(type => Post, post => post.author) 14 | posts: Post[]; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sample/sample3-many-to-one/entity/PostCategory.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index.ts"; 2 | 3 | @Entity("sample3_post_category") 4 | export class PostCategory { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column({ type: String }) 10 | name: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /sample/sample3-many-to-one/entity/PostImage.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, OneToMany, PrimaryGeneratedColumn} from "../../../src/index.ts"; 2 | import {Post} from "./Post.ts"; 3 | 4 | @Entity("sample3_post_image") 5 | export class PostImage { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column({ type: String }) 11 | url: string; 12 | 13 | @OneToMany(type => Post, post => post.image) 14 | posts: Post[]; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sample/sample3-many-to-one/entity/PostMetadata.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, OneToMany, PrimaryGeneratedColumn} from "../../../src/index.ts"; 2 | import {Post} from "./Post.ts"; 3 | 4 | @Entity("sample3_post_metadata") 5 | export class PostMetadata { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column({ type: String }) 11 | description: string; 12 | 13 | @OneToMany(type => Post, post => post.metadata) 14 | posts: Post[]; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sample/sample30-default-order-by/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity("sample30_category") 4 | export class Category { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column() 10 | name: string; 11 | 12 | constructor(name: string) { 13 | this.name = name; 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /sample/sample31-table-prefix/entity/Author.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity("sample31_author") 4 | export class Author { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column() 10 | firstName: string; 11 | 12 | @Column() 13 | lastName: string; 14 | 15 | } -------------------------------------------------------------------------------- /sample/sample31-table-prefix/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity("sample31_category") 4 | export class Category { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column() 10 | name: string; 11 | 12 | } -------------------------------------------------------------------------------- /sample/sample32-migrations/entity/Author.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity() 4 | export class Author { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column() 10 | firstName: string; 11 | 12 | @Column() 13 | lastName: string; 14 | 15 | } -------------------------------------------------------------------------------- /sample/sample32-migrations/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, ManyToOne, PrimaryGeneratedColumn} from "../../../src/index"; 2 | import {Author} from "./Author"; 3 | 4 | @Entity() 5 | export class Post { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column() 11 | title: string; 12 | 13 | @ManyToOne(type => Author, { 14 | cascade: ["insert"] 15 | }) 16 | author: Author; 17 | 18 | } -------------------------------------------------------------------------------- /sample/sample33-custom-repository/entity/Author.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity() 4 | export class Author { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column() 10 | firstName: string; 11 | 12 | @Column() 13 | lastName: string; 14 | 15 | } -------------------------------------------------------------------------------- /sample/sample33-custom-repository/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, ManyToOne, PrimaryGeneratedColumn} from "../../../src/index"; 2 | import {Author} from "./Author"; 3 | 4 | @Entity() 5 | export class Post { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column() 11 | title: string; 12 | 13 | @ManyToOne(type => Author, { 14 | cascade: ["insert"] 15 | }) 16 | author: Author; 17 | 18 | } -------------------------------------------------------------------------------- /sample/sample33-custom-repository/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | @Entity() 4 | export class User { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column() 10 | firstName: string; 11 | 12 | @Column() 13 | lastName: string; 14 | 15 | } -------------------------------------------------------------------------------- /sample/sample4-many-to-many/entity/PostAuthor.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, ManyToMany, PrimaryGeneratedColumn} from "../../../src/index.ts"; 2 | import {Post} from "./Post.ts"; 3 | 4 | @Entity("sample4_post_author") 5 | export class PostAuthor { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column({ type: String }) 11 | name: string; 12 | 13 | @ManyToMany(type => Post, post => post.authors) 14 | posts: Post[]; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sample/sample4-many-to-many/entity/PostCategory.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index.ts"; 2 | 3 | @Entity("sample4_post_category") 4 | export class PostCategory { 5 | 6 | @PrimaryGeneratedColumn() 7 | id: number; 8 | 9 | @Column({ type: String }) 10 | name: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /sample/sample4-many-to-many/entity/PostImage.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, ManyToMany, PrimaryGeneratedColumn} from "../../../src/index.ts"; 2 | import {Post} from "./Post.ts"; 3 | 4 | @Entity("sample4_post_image") 5 | export class PostImage { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column({ type: String }) 11 | url: string; 12 | 13 | @ManyToMany(type => Post, post => post.images) 14 | posts: Post[]; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sample/sample4-many-to-many/entity/PostMetadata.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, ManyToMany, PrimaryGeneratedColumn} from "../../../src/index.ts"; 2 | import {Post} from "./Post.ts"; 3 | 4 | @Entity("sample4_post_metadata") 5 | export class PostMetadata { 6 | 7 | @PrimaryGeneratedColumn() 8 | id: number; 9 | 10 | @Column({ type: String }) 11 | description: string; 12 | 13 | @ManyToMany(type => Post, post => post.metadatas) 14 | posts: Post[]; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sample/sample5-subscribers/entity/PostAuthor.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | import {Post} from "./Post"; 3 | import {OneToMany} from "../../../src/decorator/relations/OneToMany"; 4 | 5 | @Entity("sample5_post_author") 6 | export class PostAuthor { 7 | 8 | @PrimaryGeneratedColumn() 9 | id: number; 10 | 11 | @Column() 12 | name: string; 13 | 14 | @OneToMany(type => Post, post => post.author) 15 | posts: Post[]; 16 | 17 | } -------------------------------------------------------------------------------- /sample/sample6-abstract-table/entity/BasePost.ts: -------------------------------------------------------------------------------- 1 | import {Column, PrimaryGeneratedColumn} from "../../../src/index"; 2 | 3 | export class BasePost { 4 | 5 | @PrimaryGeneratedColumn() 6 | id: number; 7 | 8 | @Column() 9 | title: string; 10 | 11 | } -------------------------------------------------------------------------------- /sample/sample7-pagination/entity/PostAuthor.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../src/index"; 2 | import {Post} from "./Post"; 3 | import {OneToMany} from "../../../src/decorator/relations/OneToMany"; 4 | 5 | @Entity("sample7_post_author") 6 | export class PostAuthor { 7 | 8 | @PrimaryGeneratedColumn() 9 | id: number; 10 | 11 | @Column() 12 | name: string; 13 | 14 | @OneToMany(type => Post, post => post.author) 15 | posts: Post[]; 16 | 17 | } -------------------------------------------------------------------------------- /src/commands/types.ts: -------------------------------------------------------------------------------- 1 | import yargs from "../../vendor/https/deno.land/x/yargs/deno.ts"; 2 | import type { Arguments } from "../../vendor/https/deno.land/x/yargs/deno-types.ts"; 3 | 4 | export type Argv = ReturnType; 5 | export type { Arguments }; 6 | 7 | export interface CommandModule { 8 | command: string 9 | describe: string 10 | builder?(args: Argv): any 11 | handler(args: Arguments): any 12 | } -------------------------------------------------------------------------------- /src/common/DeepPartial.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Same as Partial but goes deeper and makes Partial all its properties and sub-properties. 3 | */ 4 | export type DeepPartial = { 5 | [P in keyof T]?: 6 | T[P] extends Array ? Array> : 7 | T[P] extends ReadonlyArray ? ReadonlyArray> : 8 | DeepPartial 9 | }; 10 | -------------------------------------------------------------------------------- /src/common/ObjectLiteral.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Interface of the simple literal object with any string keys. 3 | */ 4 | export interface ObjectLiteral { 5 | [key: string]: any; 6 | } 7 | -------------------------------------------------------------------------------- /src/common/ObjectType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Represents some Type of the Object. 3 | */ 4 | export type ObjectType = { new (): T }|Function; 5 | -------------------------------------------------------------------------------- /src/connection/typings.ts: -------------------------------------------------------------------------------- 1 | // TODO We want to generate this file automatically. 2 | export type Dotenv = { 3 | config(opts?: { 4 | path?: string; 5 | export?: boolean; 6 | }): void 7 | }; 8 | -------------------------------------------------------------------------------- /src/decorator/options/ColumnEmbeddedOptions.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Column options specific to embedded column. 3 | */ 4 | export interface ColumnEmbeddedOptions { 5 | 6 | /** 7 | * Embedded column prefix. 8 | * If set to empty string or false, then prefix is not set at all. 9 | */ 10 | prefix?: string | boolean; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/decorator/options/ColumnEnumOptions.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Column options for enum-typed columns. 3 | */ 4 | export interface ColumnEnumOptions { 5 | 6 | /** 7 | * Array of possible enumerated values. 8 | */ 9 | enum?: any[]|Object; 10 | /** 11 | * Exact name of enum 12 | */ 13 | enumName?: string; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/decorator/options/ColumnHstoreOptions.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Column options for enum-typed columns. 3 | */ 4 | export interface ColumnHstoreOptions { 5 | 6 | /** 7 | * Return type of HSTORE column. 8 | * Returns value as string or as object. 9 | */ 10 | hstoreType?: string; 11 | 12 | } -------------------------------------------------------------------------------- /src/decorator/options/ColumnWithLengthOptions.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Options for columns that can define a length of the column type. 3 | */ 4 | export interface ColumnWithLengthOptions { 5 | 6 | /** 7 | * Column type's length. 8 | * For example type = "varchar" and length = "100" means ORM will create a column with type varchar(100). 9 | */ 10 | length?: string|number; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/decorator/options/JoinColumnOptions.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Describes join column options. 3 | */ 4 | export interface JoinColumnOptions { 5 | 6 | /** 7 | * Name of the column. 8 | */ 9 | name?: string; 10 | 11 | /** 12 | * Name of the column in the entity to which this column is referenced. 13 | */ 14 | referencedColumnName?: string; // TODO rename to referencedColumn 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/decorator/options/PrimaryGeneratedColumnUUIDOptions.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Describes all options for PrimaryGeneratedColumn decorator with numeric uuid strategy. 3 | */ 4 | export interface PrimaryGeneratedColumnUUIDOptions { 5 | 6 | /** 7 | * Column name in the database. 8 | */ 9 | name?: string; 10 | 11 | /** 12 | * Column comment. Not supported by all database types. 13 | */ 14 | comment?: string; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/decorator/options/SpatialColumnOptions.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Options for spatial columns. 3 | */ 4 | export interface SpatialColumnOptions { 5 | 6 | /** 7 | * Column type's feature type. 8 | * Geometry, Point, Polygon, etc. 9 | */ 10 | spatialFeatureType?: string; 11 | 12 | /** 13 | * Column type's SRID. 14 | * Spatial Reference ID or EPSG code. 15 | */ 16 | srid?: number; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/decorator/options/TransactionOptions.ts: -------------------------------------------------------------------------------- 1 | import { IsolationLevel } from "../../driver/types/IsolationLevel.ts"; 2 | 3 | export interface TransactionOptions { 4 | connectionName?: string; 5 | isolation?: IsolationLevel; 6 | } 7 | -------------------------------------------------------------------------------- /src/decorator/options/ValueTransformer.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Interface for objects that deal with (un)marshalling data. 3 | */ 4 | export interface ValueTransformer { 5 | 6 | /** 7 | * Used to marshal data when writing to the database. 8 | */ 9 | to(value: any): any; 10 | 11 | /** 12 | * Used to unmarshal data when reading from the database. 13 | */ 14 | from(value: any): any; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/driver/Query.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This class stores query and its parameters 3 | */ 4 | export class Query { 5 | constructor(public query: string, public parameters?: any[]) { 6 | 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/driver/SqlInMemory.ts: -------------------------------------------------------------------------------- 1 | import {Query} from "./Query.ts"; 2 | 3 | /** 4 | * This class stores up and down queries needed for migrations functionality. 5 | */ 6 | export class SqlInMemory { 7 | upQueries: Query[] = []; 8 | downQueries: Query[] = []; 9 | } 10 | -------------------------------------------------------------------------------- /src/driver/expo/ExpoConnectionOptions.ts: -------------------------------------------------------------------------------- 1 | import {BaseConnectionOptions} from "../../connection/BaseConnectionOptions.ts"; 2 | 3 | /** 4 | * Sqlite-specific connection options. 5 | */ 6 | export interface ExpoConnectionOptions extends BaseConnectionOptions { 7 | 8 | /** 9 | * Database type. 10 | */ 11 | readonly type: "expo"; 12 | 13 | /** 14 | * Database name. 15 | */ 16 | readonly database: string; 17 | } 18 | -------------------------------------------------------------------------------- /src/driver/types/DataTypeDefaults.ts: -------------------------------------------------------------------------------- 1 | export interface DataTypeDefaults { 2 | [type: string]: { 3 | length?: number; 4 | width?: number; 5 | precision?: number; 6 | scale?: number; 7 | }; 8 | } -------------------------------------------------------------------------------- /src/driver/types/DatabaseType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Database type. 3 | */ 4 | export type DatabaseType = 5 | "mysql"| 6 | "postgres"| 7 | "cockroachdb"| 8 | "sap"| 9 | "mariadb"| 10 | "sqlite"| 11 | "cordova"| 12 | "react-native"| 13 | "nativescript" | 14 | "sqljs"| 15 | "oracle"| 16 | "mssql"| 17 | "mongodb"| 18 | "aurora-data-api"| 19 | "expo"; 20 | -------------------------------------------------------------------------------- /src/driver/types/IsolationLevel.ts: -------------------------------------------------------------------------------- 1 | export type IsolationLevel = "READ UNCOMMITTED" | "READ COMMITTED" | "REPEATABLE READ" | "SERIALIZABLE"; 2 | -------------------------------------------------------------------------------- /src/entity-schema/EntitySchema.ts: -------------------------------------------------------------------------------- 1 | import {EntitySchemaOptions} from "./EntitySchemaOptions.ts"; 2 | 3 | /** 4 | * Interface for entity metadata mappings stored inside "schemas" instead of models decorated by decorators. 5 | */ 6 | export class EntitySchema { 7 | 8 | constructor(public options: EntitySchemaOptions) { 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/entity-schema/EntitySchemaCheckOptions.ts: -------------------------------------------------------------------------------- 1 | export interface EntitySchemaCheckOptions { 2 | 3 | /** 4 | * Check constraint name. 5 | */ 6 | name?: string; 7 | 8 | /** 9 | * Check expression. 10 | */ 11 | expression: string; 12 | 13 | } -------------------------------------------------------------------------------- /src/entity-schema/EntitySchemaExclusionOptions.ts: -------------------------------------------------------------------------------- 1 | export interface EntitySchemaExclusionOptions { 2 | 3 | /** 4 | * Exclusion constraint name. 5 | */ 6 | name?: string; 7 | 8 | /** 9 | * Exclusion expression. 10 | */ 11 | expression: string; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/entity-schema/EntitySchemaUniqueOptions.ts: -------------------------------------------------------------------------------- 1 | export interface EntitySchemaUniqueOptions { 2 | 3 | /** 4 | * Unique constraint name. 5 | */ 6 | name?: string; 7 | 8 | /** 9 | * Unique column names. 10 | */ 11 | columns?: ((object?: any) => (any[]|{ [key: string]: number }))|string[]; 12 | 13 | } -------------------------------------------------------------------------------- /src/error/ConnectionNotFoundError.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Thrown when consumer tries to get connection that does not exist. 3 | */ 4 | export class ConnectionNotFoundError extends Error { 5 | name = "ConnectionNotFoundError"; 6 | 7 | constructor(name: string) { 8 | super(); 9 | Object.setPrototypeOf(this, ConnectionNotFoundError.prototype); 10 | this.message = `Connection "${name}" was not found.`; 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/error/DriverOptionNotSetError.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Thrown if some required driver's option is not set. 3 | */ 4 | export class DriverOptionNotSetError extends Error { 5 | name = "DriverOptionNotSetError"; 6 | 7 | constructor(optionName: string) { 8 | super(); 9 | Object.setPrototypeOf(this, DriverOptionNotSetError.prototype); 10 | this.message = `Driver option (${optionName}) is not set. Please set it to perform connection to the database.`; 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/error/EntityColumnNotFound.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | export class EntityColumnNotFound extends Error { 5 | name = "EntityColumnNotFound"; 6 | 7 | constructor(propertyPath: string) { 8 | super(); 9 | Object.setPrototypeOf(this, EntityColumnNotFound.prototype); 10 | this.message = `No entity column "${propertyPath}" was found.`; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/error/LockNotSupportedOnGivenDriverError.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Thrown when selected sql driver does not supports locking. 3 | */ 4 | export class LockNotSupportedOnGivenDriverError extends Error { 5 | name = "LockNotSupportedOnGivenDriverError"; 6 | 7 | constructor() { 8 | super(); 9 | Object.setPrototypeOf(this, LockNotSupportedOnGivenDriverError.prototype); 10 | this.message = `Locking not supported on given driver.`; 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/error/MustBeEntityError.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Thrown when method expects entity but instead something else is given. 3 | */ 4 | export class MustBeEntityError extends Error { 5 | name = "MustBeEntityError"; 6 | 7 | constructor(operation: string, wrongValue: any) { 8 | super(); 9 | Object.setPrototypeOf(this, MustBeEntityError.prototype); 10 | this.message = `Cannot ${operation}, given value must be an entity, instead "${wrongValue}" is given.`; 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/error/NotImplementedError.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Thrown when user tries to call unimplemented method. 3 | */ 4 | export class NotImplementedError extends Error { 5 | name = "NotImplementedError"; 6 | 7 | constructor(functionName: string) { 8 | super(); 9 | this.message = `\`${functionName}\` is not supported`; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/error/OptimisticLockCanNotBeUsedError.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Thrown when an optimistic lock cannot be used in query builder. 3 | */ 4 | export class OptimisticLockCanNotBeUsedError extends Error { 5 | name = "OptimisticLockCanNotBeUsedError"; 6 | 7 | constructor() { 8 | super(); 9 | Object.setPrototypeOf(this, OptimisticLockCanNotBeUsedError.prototype); 10 | this.message = `The optimistic lock can be used only with getOne() method.`; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/error/PersistedEntityNotFoundError.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Thrown . Theoretically can't be thrown. 3 | */ 4 | export class PersistedEntityNotFoundError extends Error { 5 | name = "PersistedEntityNotFoundError"; 6 | 7 | constructor() { 8 | super(); 9 | Object.setPrototypeOf(this, PersistedEntityNotFoundError.prototype); 10 | this.message = `Internal error. Persisted entity was not found in the list of prepared operated entities.`; 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/error/QueryRunnerAlreadyReleasedError.ts: -------------------------------------------------------------------------------- 1 | /** 2 | */ 3 | export class QueryRunnerAlreadyReleasedError extends Error { 4 | name = "QueryRunnerAlreadyReleasedError"; 5 | 6 | constructor() { 7 | super(); 8 | Object.setPrototypeOf(this, QueryRunnerAlreadyReleasedError.prototype); 9 | this.message = `Query runner already released. Cannot run queries anymore.`; 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /src/error/TreeRepositoryNotSupportedError.ts: -------------------------------------------------------------------------------- 1 | import {Driver} from "../driver/Driver.ts"; 2 | 3 | export class TreeRepositoryNotSupportedError extends Error { 4 | name = "TreeRepositoryNotSupportedError"; 5 | 6 | constructor(driver: Driver) { 7 | super(); 8 | Object.setPrototypeOf(this, TreeRepositoryNotSupportedError.prototype); 9 | this.message = `Tree repositories are not supported in ${driver.options.type} driver.`; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/find-options/FindConditions.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "./FindOperator.ts"; 2 | 3 | /** 4 | * Used for find operations. 5 | */ 6 | export type FindConditions = { 7 | [P in keyof T]?: T[P] extends never ? FindConditions|FindOperator> : FindConditions|FindOperator>; 8 | }; 9 | -------------------------------------------------------------------------------- /src/find-options/FindOperatorType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * List of types that FindOperator can be. 3 | */ 4 | export type FindOperatorType = "not" 5 | | "lessThan" 6 | | "lessThanOrEqual" 7 | | "moreThan" 8 | | "moreThanOrEqual" 9 | | "equal" 10 | | "between" 11 | | "in" 12 | | "any" 13 | | "isNull" 14 | | "like" 15 | | "raw"; 16 | -------------------------------------------------------------------------------- /src/find-options/OrderByCondition.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Special object that defines order condition for ORDER BY in sql. 3 | * 4 | * Example: 5 | * { 6 | * "name": "ASC", 7 | * "id": "DESC" 8 | * } 9 | */ 10 | export type OrderByCondition = { 11 | [columnName: string]: ("ASC"|"DESC")|{ 12 | order: "ASC"|"DESC"; 13 | nulls?: "NULLS FIRST"|"NULLS LAST"; 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /src/find-options/operator/Any.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "../FindOperator.ts"; 2 | 3 | /** 4 | * Find Options Operator. 5 | * Example: { someField: Any([...]) } 6 | */ 7 | export function Any(value: T[]|FindOperator) { 8 | return new FindOperator("any", value as any); 9 | } 10 | -------------------------------------------------------------------------------- /src/find-options/operator/Between.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "../FindOperator.ts"; 2 | 3 | /** 4 | * Find Options Operator. 5 | * Example: { someField: Between(x, y) } 6 | */ 7 | export function Between(from: T|FindOperator, to: T|FindOperator) { 8 | return new FindOperator("between", [from, to] as any, true, true); 9 | } 10 | -------------------------------------------------------------------------------- /src/find-options/operator/Equal.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "../FindOperator.ts"; 2 | 3 | /** 4 | * Find Options Operator. 5 | * Example: { someField: Equal("value") } 6 | */ 7 | export function Equal(value: T|FindOperator) { 8 | return new FindOperator("equal", value); 9 | } 10 | -------------------------------------------------------------------------------- /src/find-options/operator/In.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "../FindOperator.ts"; 2 | 3 | /** 4 | * Find Options Operator. 5 | * Example: { someField: In([...]) } 6 | */ 7 | export function In(value: T[]|FindOperator) { 8 | return new FindOperator("in", value as any, true, true); 9 | } 10 | -------------------------------------------------------------------------------- /src/find-options/operator/IsNull.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "../FindOperator.ts"; 2 | 3 | /** 4 | * Find Options Operator. 5 | * Example: { someField: IsNull() } 6 | */ 7 | export function IsNull() { 8 | return new FindOperator("isNull", undefined as any, false); 9 | } 10 | -------------------------------------------------------------------------------- /src/find-options/operator/LessThan.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "../FindOperator.ts"; 2 | 3 | /** 4 | * Find Options Operator. 5 | * Example: { someField: LessThan(10) } 6 | */ 7 | export function LessThan(value: T|FindOperator) { 8 | return new FindOperator("lessThan", value); 9 | } 10 | -------------------------------------------------------------------------------- /src/find-options/operator/LessThanOrEqual.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "../FindOperator.ts"; 2 | 3 | /** 4 | * Find Options Operator. 5 | * Example: { someField: LessThanOrEqual(10) } 6 | */ 7 | export function LessThanOrEqual(value: T|FindOperator) { 8 | return new FindOperator("lessThanOrEqual", value); 9 | } 10 | -------------------------------------------------------------------------------- /src/find-options/operator/Like.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "../FindOperator.ts"; 2 | 3 | /** 4 | * Find Options Operator. 5 | * Example: { someField: Like("%some sting%") } 6 | */ 7 | export function Like(value: T|FindOperator) { 8 | return new FindOperator("like", value); 9 | } 10 | -------------------------------------------------------------------------------- /src/find-options/operator/MoreThan.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "../FindOperator.ts"; 2 | 3 | /** 4 | * Find Options Operator. 5 | * Example: { someField: MoreThan(10) } 6 | */ 7 | export function MoreThan(value: T|FindOperator) { 8 | return new FindOperator("moreThan", value); 9 | } 10 | -------------------------------------------------------------------------------- /src/find-options/operator/MoreThanOrEqual.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "../FindOperator.ts"; 2 | 3 | /** 4 | * Find Options Operator. 5 | * Example: { someField: MoreThanOrEqual(10) } 6 | */ 7 | export function MoreThanOrEqual(value: T|FindOperator) { 8 | return new FindOperator("moreThanOrEqual", value); 9 | } 10 | -------------------------------------------------------------------------------- /src/find-options/operator/Not.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "../FindOperator.ts"; 2 | 3 | /** 4 | * Find Options Operator. 5 | * Used to negotiate expression. 6 | * Example: { title: not("hello") } will return entities where title not equal to "hello". 7 | */ 8 | export function Not(value: T|FindOperator) { 9 | return new FindOperator("not", value); 10 | } 11 | -------------------------------------------------------------------------------- /src/find-options/operator/Raw.ts: -------------------------------------------------------------------------------- 1 | import {FindOperator} from "../FindOperator.ts"; 2 | 3 | /** 4 | * Find Options Operator. 5 | * Example: { someField: Raw([...]) } 6 | */ 7 | export function Raw(value: string|((columnAlias?: string) => string)) { 8 | return new FindOperator("raw", value as any, false); 9 | } 10 | -------------------------------------------------------------------------------- /src/logger/LoggerOptions.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Logging options. 3 | */ 4 | export type LoggerOptions = boolean|"all"|("query"|"schema"|"error"|"warn"|"info"|"log"|"migration")[]; 5 | -------------------------------------------------------------------------------- /src/metadata-args/CheckMetadataArgs.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Arguments for CheckMetadata class. 3 | */ 4 | export interface CheckMetadataArgs { 5 | 6 | /** 7 | * Class to which index is applied. 8 | */ 9 | target: Function|string; 10 | 11 | /** 12 | * Check constraint name. 13 | */ 14 | name?: string; 15 | 16 | /** 17 | * Check expression. 18 | */ 19 | expression: string; 20 | } 21 | -------------------------------------------------------------------------------- /src/metadata-args/DiscriminatorValueMetadataArgs.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * DiscriminatorValue properties. 3 | */ 4 | export interface DiscriminatorValueMetadataArgs { 5 | 6 | /** 7 | * Class to which discriminator name is applied. 8 | */ 9 | readonly target: Function|string; 10 | 11 | /** 12 | * Discriminator value. 13 | */ 14 | readonly value: any; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/metadata-args/EntitySubscriberMetadataArgs.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Arguments for EntitySubscriberMetadata class. 3 | */ 4 | export interface EntitySubscriberMetadataArgs { 5 | 6 | /** 7 | * Class to which subscriber is applied. 8 | */ 9 | readonly target: Function; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/metadata-args/ExclusionMetadataArgs.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Arguments for ExclusionMetadata class. 3 | */ 4 | export interface ExclusionMetadataArgs { 5 | 6 | /** 7 | * Class to which index is applied. 8 | */ 9 | target: Function|string; 10 | 11 | /** 12 | * Exclusion constraint name. 13 | */ 14 | name?: string; 15 | 16 | /** 17 | * Exclusion expression. 18 | */ 19 | expression: string; 20 | } 21 | -------------------------------------------------------------------------------- /src/metadata-args/NamingStrategyMetadataArgs.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Arguments for NamingStrategyMetadata class. 3 | */ 4 | export interface NamingStrategyMetadataArgs { 5 | 6 | /** 7 | * Class to which this column is applied. 8 | */ 9 | readonly target: Function; 10 | 11 | /** 12 | * Strategy name. 13 | */ 14 | readonly name: string; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/metadata-args/TreeMetadataArgs.ts: -------------------------------------------------------------------------------- 1 | import {TreeType} from "../metadata/types/TreeTypes.ts"; 2 | 3 | /** 4 | * Stores metadata collected for Tree entities. 5 | */ 6 | export interface TreeMetadataArgs { 7 | 8 | /** 9 | * Entity to which tree is applied. 10 | */ 11 | target: Function|string; 12 | 13 | /** 14 | * Tree type. 15 | */ 16 | type: TreeType; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/metadata-args/types/ColumnMode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Kinda type of the column. Not a type in the database, but locally used type to determine what kind of column 3 | * we are working with. 4 | * For example, "primary" means that it will be a primary column, or "createDate" means that it will create a create 5 | * date column. 6 | */ 7 | export type ColumnMode = "regular"|"virtual"|"createDate"|"updateDate"|"version"|"treeChildrenCount"|"treeLevel"|"objectId"|"array"; 8 | -------------------------------------------------------------------------------- /src/metadata/types/DeferrableType.ts: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * DEFERRABLE type to be used to specify if foreign key constraints can be deferred. 4 | */ 5 | export type DeferrableType = "INITIALLY IMMEDIATE"|"INITIALLY DEFERRED"; 6 | -------------------------------------------------------------------------------- /src/metadata/types/OnDeleteType.ts: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * ON_DELETE type to be used to specify delete strategy when some relation is being deleted from the database. 4 | */ 5 | export type OnDeleteType = "RESTRICT"|"CASCADE"|"SET NULL"|"DEFAULT"|"NO ACTION"; 6 | -------------------------------------------------------------------------------- /src/metadata/types/OnUpdateType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * ON_UPDATE type to be used to specify update strategy when some relation is being updated. 3 | */ 4 | export type OnUpdateType = "RESTRICT"|"CASCADE"|"SET NULL"|"DEFAULT"|"NO ACTION"; 5 | -------------------------------------------------------------------------------- /src/metadata/types/PropertyTypeInFunction.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Contains the name of the property of the object, or the function that returns this name. 3 | */ 4 | export type PropertyTypeFactory = string|((t: T) => string|any); 5 | -------------------------------------------------------------------------------- /src/metadata/types/RelationTypeInFunction.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Function that returns a type of the field. Returned value must be a class used on the relation. 3 | */ 4 | export type RelationTypeInFunction = ((type?: any) => Function)|Function|string; // todo: |string ? 5 | 6 | -------------------------------------------------------------------------------- /src/metadata/types/RelationTypes.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * All types that relation can be. 3 | */ 4 | export type RelationType = "one-to-one"|"one-to-many"|"many-to-one"|"many-to-many"; -------------------------------------------------------------------------------- /src/metadata/types/TableTypes.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Table type. Tables can be abstract, closure, junction, embedded, etc. 3 | */ 4 | export type TableType = "regular"|"view"|"junction"|"closure"|"closure-junction"|"entity-child"; 5 | -------------------------------------------------------------------------------- /src/metadata/types/TreeTypes.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Tree type. 3 | * Specifies what table pattern will be used for the tree entity. 4 | */ 5 | export type TreeType = "adjacency-list"|"closure-table"|"nested-set"|"materialized-path"; 6 | -------------------------------------------------------------------------------- /src/query-builder/JoinOptions.ts: -------------------------------------------------------------------------------- 1 | export interface JoinOptions { 2 | limit?: number; 3 | } -------------------------------------------------------------------------------- /src/query-builder/SelectQuery.ts: -------------------------------------------------------------------------------- 1 | export interface SelectQuery { 2 | selection: string; 3 | aliasName?: string; 4 | virtual?: boolean; 5 | } -------------------------------------------------------------------------------- /src/query-builder/SelectQueryBuilderOption.ts: -------------------------------------------------------------------------------- 1 | export type SelectQueryBuilderOption = "disable-global-order"|"create-pojo"; -------------------------------------------------------------------------------- /src/query-builder/relation-count/RelationCountLoadResult.ts: -------------------------------------------------------------------------------- 1 | import {RelationCountAttribute} from "./RelationCountAttribute.ts"; 2 | 3 | export interface RelationCountLoadResult { 4 | relationCountAttribute: RelationCountAttribute; 5 | results: { cnt: any, parentId: any }[]; 6 | } 7 | -------------------------------------------------------------------------------- /src/query-builder/relation-id/RelationIdLoadResult.ts: -------------------------------------------------------------------------------- 1 | import {RelationIdAttribute} from "./RelationIdAttribute.ts"; 2 | 3 | export interface RelationIdLoadResult { 4 | relationIdAttribute: RelationIdAttribute; 5 | results: any[]; 6 | } 7 | -------------------------------------------------------------------------------- /src/query-builder/result/DeleteResult.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Result object returned by DeleteQueryBuilder execution. 3 | */ 4 | export class DeleteResult { 5 | /** 6 | * Raw SQL result returned by executed query. 7 | */ 8 | raw: any; 9 | 10 | /** 11 | * Number of affected rows/documents 12 | * Not all drivers support this 13 | */ 14 | affected?: number|null; 15 | } 16 | -------------------------------------------------------------------------------- /src/repository/EntityId.ts: -------------------------------------------------------------------------------- 1 | import {ObjectID} from "../driver/mongodb/typings.ts"; 2 | 3 | export type EntityId = string|number|Date|ObjectID; 4 | -------------------------------------------------------------------------------- /src/subscriber/BroadcasterResult.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Broadcaster execution result - promises executed by operations and number of executed listeners and subscribers. 3 | */ 4 | export class BroadcasterResult { 5 | 6 | /** 7 | * Number of executed listeners and subscribers. 8 | */ 9 | count: number = 0; 10 | 11 | /** 12 | * Promises returned by listeners and subscribers which needs to be awaited. 13 | */ 14 | promises: Promise[] = []; 15 | 16 | } -------------------------------------------------------------------------------- /src/util/SqlUtils.ts: -------------------------------------------------------------------------------- 1 | export class SqlUtils { 2 | static isInsertQuery(query: string) : boolean { 3 | return query.substr(0, 11) === "INSERT INTO"; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/util/fs.ts: -------------------------------------------------------------------------------- 1 | export { ensureDir } from "../../vendor/https/deno.land/std/fs/ensure_dir.ts"; 2 | export { expandGlob } from "../../vendor/https/deno.land/std/fs/expand_glob.ts"; 3 | export { exists, existsSync } from "../../vendor/https/deno.land/std/fs/exists.ts"; 4 | export { emptyDir } from "../../vendor/https/deno.land/std/fs/empty_dir.ts"; 5 | -------------------------------------------------------------------------------- /src/version.ts: -------------------------------------------------------------------------------- 1 | export const VERSION = "v0.2.23-rc10"; 2 | export const BASE_TYPEORM_VERSION = "v0.2.22"; 3 | export const MOD_URL = `https://denolib.com/denolib/typeorm@${VERSION}/mod.ts`; 4 | export const CLI_URL = `https://denolib.com/denolib/typeorm@${VERSION}/cli.ts`; 5 | -------------------------------------------------------------------------------- /temp/.gitignore: -------------------------------------------------------------------------------- 1 | ** 2 | !.gitignore -------------------------------------------------------------------------------- /test/deps/chai.ts: -------------------------------------------------------------------------------- 1 | import "./global.ts"; 2 | // @deno-types="https://unpkg.com/@types/chai@4.2.7/index.d.ts" 3 | import "https://unpkg.com/chai@4.2.0/chai.js"; 4 | 5 | chai.should(); 6 | export const expect = chai.expect; 7 | export const should = chai.should; 8 | -------------------------------------------------------------------------------- /test/deps/global.ts: -------------------------------------------------------------------------------- 1 | (window as any)['global'] = window; 2 | 3 | // * `window.location` was removed in Deno@v1.0.0-rc1. 4 | // * Mocha depends on `window.location`. 5 | if ((window as any).location == null) { 6 | (window as any).location = {}; 7 | } 8 | -------------------------------------------------------------------------------- /test/deps/sinon.ts: -------------------------------------------------------------------------------- 1 | // @deno-types="https://unpkg.com/@types/sinon@2.3.0/index.d.ts" 2 | import sinon from "https://dev.jspm.io/sinon@8.1.1"; 3 | //import sinon from 'https://cdn.pika.dev/sinon@^8.1.1'; 4 | 5 | export default sinon; 6 | -------------------------------------------------------------------------------- /test/functional/columns/embedded-columns/entity/Information.ts: -------------------------------------------------------------------------------- 1 | import { Column } from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Information { 4 | 5 | @Column({ name: "descr", type: String }) 6 | description!: string; 7 | } 8 | -------------------------------------------------------------------------------- /test/functional/columns/value-transformer/entity/View.ts: -------------------------------------------------------------------------------- 1 | import { Entity, PrimaryGeneratedColumn, Column } from "../../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class View { 5 | @PrimaryGeneratedColumn("uuid") 6 | id!: string; 7 | 8 | @Column({type: String, transformer: []}) 9 | title!: string; 10 | } 11 | -------------------------------------------------------------------------------- /test/functional/connection-options-reader/configs/.env: -------------------------------------------------------------------------------- 1 | TYPEORM_CONNECTION = mysql 2 | TYPEORM_DATABASE = test-js 3 | -------------------------------------------------------------------------------- /test/functional/connection-options-reader/configs/config.yml: -------------------------------------------------------------------------------- 1 | default: 2 | type: "sqlite" 3 | database: "sqlitedb" 4 | sample: 5 | type: "mysql" 6 | database: "mysqldb" 7 | username: "test" 8 | password: "test" -------------------------------------------------------------------------------- /test/functional/connection-options-reader/configs/sqlite-memory.ts: -------------------------------------------------------------------------------- 1 | export default [{ 2 | type: "sqlite", 3 | name: "file", 4 | database: "test" 5 | }, { 6 | type: "sqlite", 7 | name: "memory", 8 | database: ":memory:", 9 | }]; 10 | -------------------------------------------------------------------------------- /test/functional/connection-options-reader/configs/test-path-config-async.js: -------------------------------------------------------------------------------- 1 | export default Promise.resolve({ 2 | type: "sqlite", 3 | name: "file", 4 | database: "test-js-async" 5 | }); 6 | -------------------------------------------------------------------------------- /test/functional/connection-options-reader/configs/test-path-config.js: -------------------------------------------------------------------------------- 1 | export default [{ 2 | type: "sqlite", 3 | name: "file", 4 | database: "test-js" 5 | }]; 6 | -------------------------------------------------------------------------------- /test/functional/connection/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/connection/entity/View.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryColumn} from "../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity("view", { synchronize: false }) 6 | export class View { 7 | 8 | @PrimaryColumn({ type: Number }) 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/connection/modules/blog/entity/Blog.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Blog { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/connection/modules/blog/schema/blog-category.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "BlogCategory", 3 | "table": { 4 | "name": "blog_category" 5 | }, 6 | "columns": { 7 | "id": { 8 | "type": "int", 9 | "primary": true, 10 | "generated": true 11 | }, 12 | "name": { 13 | "type": "varchar", 14 | "nullable": false 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /test/functional/connection/modules/question/schema/question-category.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "QuestionCategory", 3 | "table": { 4 | "name": "question_category" 5 | }, 6 | "columns": { 7 | "id": { 8 | "type": "int", 9 | "primary": true, 10 | "generated": true 11 | }, 12 | "name": { 13 | "type": "varchar", 14 | "nullable": false 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /test/functional/connection/modules/video/entity/Video.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Video { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/connection/modules/video/schema/video-category.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "VideoCategory", 3 | "table": { 4 | "name": "video_category" 5 | }, 6 | "columns": { 7 | "id": { 8 | "type": "int", 9 | "primary": true, 10 | "generated": true 11 | }, 12 | "name": { 13 | "type": "varchar", 14 | "nullable": false 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /test/functional/connection/schema/photo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Photo", 3 | "table": { 4 | "name": "photo" 5 | }, 6 | "columns": { 7 | "id": { 8 | "type": "int", 9 | "primary": true, 10 | "generated": true 11 | }, 12 | "description": { 13 | "type": "varchar", 14 | "nullable": false 15 | }, 16 | "url": { 17 | "type": "varchar", 18 | "nullable": false 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /test/functional/connection/schema/user.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "User", 3 | "table": { 4 | "name": "user" 5 | }, 6 | "columns": { 7 | "id": { 8 | "type": "int", 9 | "primary": true, 10 | "generated": true 11 | }, 12 | "firstName": { 13 | "type": "varchar", 14 | "nullable": false 15 | }, 16 | "secondName": { 17 | "type": "varchar", 18 | "nullable": false 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /test/functional/database-schema/column-types/mssql/enum/FruitEnum.ts: -------------------------------------------------------------------------------- 1 | export enum FruitEnum { 2 | Apple = "apple", 3 | Pineapple = "pineapple", 4 | Banana = "banana" 5 | } -------------------------------------------------------------------------------- /test/functional/database-schema/column-types/mysql/enum/FruitEnum.ts: -------------------------------------------------------------------------------- 1 | export enum FruitEnum { 2 | Apple = "apple", 3 | Pineapple = "pineapple", 4 | Banana = "banana" 5 | } -------------------------------------------------------------------------------- /test/functional/database-schema/column-types/sqlite/enum/FruitEnum.ts: -------------------------------------------------------------------------------- 1 | export enum FruitEnum { 2 | Apple = "apple", 3 | Pineapple = "pineapple", 4 | Banana = "banana" 5 | } -------------------------------------------------------------------------------- /test/functional/decorators/embedded/entity/Counters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Counters { 4 | 5 | @Column({ type: Number }) 6 | likes!: number; 7 | 8 | @Column({ type: Number }) 9 | comments!: number; 10 | 11 | @Column({ type: Number }) 12 | favorites!: number; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/deferrable/entity/Company.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryColumn} from "../../../../src/decorator/columns/PrimaryColumn.ts"; 4 | 5 | @Entity() 6 | export class Company { 7 | 8 | @PrimaryColumn({ type: Number }) 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name?: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/driver/convert-to-entity/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryColumn} from "../../../../../src/decorator/columns/PrimaryColumn.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryColumn("int") 9 | id!: number; 10 | 11 | @Column({nullable: true, type: Boolean}) 12 | isNew!: boolean; 13 | } 14 | -------------------------------------------------------------------------------- /test/functional/embedded/basic-functionality/entity/Counters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Counters { 4 | 5 | @Column({ type: Number }) 6 | likes!: number; 7 | 8 | @Column({ type: Number }) 9 | comments!: number; 10 | 11 | @Column({ type: Number }) 12 | favorites!: number; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/embedded/embedded-many-to-many-case1/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Subcounters { 4 | 5 | @Column({ type: Number }) 6 | version!: number; 7 | 8 | @Column({ type: Number }) 9 | watches!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/embedded/embedded-many-to-many-case2/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Subcounters { 4 | 5 | @Column({ type: Number }) 6 | version!: number; 7 | 8 | @Column({ type: Number }) 9 | watches!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/embedded/embedded-many-to-many-case3/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | import {PrimaryColumn} from "../../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | 4 | export class Subcounters { 5 | 6 | @PrimaryColumn({ type: Number }) 7 | version!: number; 8 | 9 | @Column({ type: Number }) 10 | watches!: number; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/functional/embedded/embedded-many-to-many-case4/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Subcounters { 4 | 5 | @Column({ type: Number }) 6 | version!: number; 7 | 8 | @Column({ type: Number }) 9 | watches!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/embedded/embedded-many-to-many-case5/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | import {PrimaryColumn} from "../../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | 4 | export class Subcounters { 5 | 6 | @PrimaryColumn({ type: Number }) 7 | version!: number; 8 | 9 | @Column({ type: Number }) 10 | watches!: number; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/functional/embedded/embedded-many-to-one-case1/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Subcounters { 4 | 5 | @Column({ type: Number }) 6 | version!: number; 7 | 8 | @Column({ type: Number }) 9 | watches!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/embedded/embedded-many-to-one-case2/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Subcounters { 4 | 5 | @Column({ type: Number }) 6 | version!: number; 7 | 8 | @Column({ type: Number }) 9 | watches!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/embedded/embedded-many-to-one-case3/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | import {PrimaryColumn} from "../../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | 4 | export class Subcounters { 5 | 6 | @PrimaryColumn({ type: Number }) 7 | version!: number; 8 | 9 | @Column({ type: Number }) 10 | watches!: number; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/functional/embedded/embedded-many-to-one-case4/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Subcounters { 4 | 5 | @Column({ type: Number }) 6 | version!: number; 7 | 8 | @Column({ type: Number }) 9 | watches!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/embedded/embedded-many-to-one-case5/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | import {PrimaryColumn} from "../../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | 4 | export class Subcounters { 5 | 6 | @PrimaryColumn({ type: Number }) 7 | version!: number; 8 | 9 | @Column({ type: Number }) 10 | watches!: number; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/functional/embedded/embedded-one-to-one/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Subcounters { 4 | 5 | @Column({ type: Number }) 6 | version!: number; 7 | 8 | @Column({ type: Number }) 9 | watches!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/embedded/embedded-with-special-columns/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | import {VersionColumn} from "../../../../../src/decorator/columns/VersionColumn.ts"; 3 | 4 | export class Subcounters { 5 | 6 | @VersionColumn({ type: Number }) 7 | version!: number; 8 | 9 | @Column({ type: Number }) 10 | watches!: number; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/functional/embedded/multiple-primary-columns-with-nested-embed/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | import {PrimaryColumn} from "../../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | 4 | export class Subcounters { 5 | 6 | @PrimaryColumn({ type: Number }) 7 | version!: number; 8 | 9 | @Column({ type: Number }) 10 | watches!: number; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/functional/embedded/prefix/entity/Counters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Counters { 4 | 5 | @Column({ name: "_likes", type: Number }) 6 | likes!: number; 7 | 8 | @Column({ name: "_comments", type: Number }) 9 | comments!: number; 10 | 11 | @Column({ name: "_favorites", type: Number }) 12 | favorites!: number; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/entity-schema/basic/entity/CategoryEntity.ts: -------------------------------------------------------------------------------- 1 | import {EntitySchema} from "../../../../../src/index.ts"; 2 | import {Category} from "../model/Category.ts"; 3 | 4 | export const CategoryEntity = new EntitySchema({ 5 | name: "category", 6 | columns: { 7 | id: { 8 | type: Number, 9 | primary: true, 10 | generated: true 11 | }, 12 | name: { 13 | type: String 14 | } 15 | } 16 | }); 17 | -------------------------------------------------------------------------------- /test/functional/entity-schema/basic/model/Category.ts: -------------------------------------------------------------------------------- 1 | export interface Category { 2 | 3 | id: number; 4 | name: string; 5 | 6 | } -------------------------------------------------------------------------------- /test/functional/entity-schema/basic/model/Post.ts: -------------------------------------------------------------------------------- 1 | import {Category} from "./Category.ts"; 2 | 3 | export interface Post { 4 | 5 | id: number; 6 | title: string; 7 | text: string; 8 | categories: Category[]; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /test/functional/entity-schema/target/model/Post.ts: -------------------------------------------------------------------------------- 1 | export class Post { 2 | 3 | id!: number; 4 | title!: string; 5 | text!: string; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /test/functional/indices/embeddeds-index-test/entity/Profile.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | import {Index} from "../../../../../src/decorator/Index.ts"; 3 | 4 | export class Profile { 5 | 6 | @Column({ type: String }) 7 | job!: string; 8 | 9 | @Column({ type: String }) 10 | @Index("customer_profile_address") 11 | address!: string; 12 | } 13 | -------------------------------------------------------------------------------- /test/functional/metadata-builder/column-metadata/entity/Subcounters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Subcounters { 4 | 5 | @Column({ type: Number }) 6 | version!: number; 7 | 8 | @Column({ type: Number }) 9 | watches!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/metadata-builder/metadata-args-storage/entity/ContentModule.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | import {Unit} from "./Unit.ts"; 3 | 4 | export class ContentModule extends Unit { 5 | 6 | @Column({ type: String }) 7 | tag!: string; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/functional/metadata-builder/metadata-args-storage/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 3 | import {ContentModule} from "./ContentModule.ts"; 4 | 5 | @Entity() 6 | export class Post extends ContentModule { 7 | 8 | @Column({ type: String }) 9 | title!: string; 10 | 11 | @Column({ type: String }) 12 | text!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/metadata-builder/metadata-args-storage/entity/Unit.ts: -------------------------------------------------------------------------------- 1 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 2 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 3 | 4 | export class Unit { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: string; 8 | 9 | @Column({ type: String }) 10 | type!: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/functional/migrations/show-command/migration/1530542855524-ExampleMigration.ts: -------------------------------------------------------------------------------- 1 | import { MigrationInterface } from "../../../../../src/migration/MigrationInterface.ts"; 2 | import { QueryRunner } from "../../../../../src/query-runner/QueryRunner.ts"; 3 | 4 | export class ExampleMigration1530542855524 implements MigrationInterface { 5 | public async up(queryRunner: QueryRunner): Promise { 6 | } 7 | public async down(queryRunner: QueryRunner): Promise { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/functional/mongodb/basic/array-columns/entity/Counters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Counters { 4 | 5 | @Column({ type: Number }) 6 | likes!: number; 7 | 8 | @Column({ type: String }) 9 | text!: string; 10 | 11 | constructor(likes: number, text: string) { 12 | this.likes = likes; 13 | this.text = text; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /test/functional/mongodb/basic/embedded-columns/entity/EditHistory.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class EditHistory { 4 | 5 | @Column({ type: String }) 6 | title!: string; 7 | 8 | @Column({ type: String }) 9 | text!: string; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/mongodb/basic/embedded-columns/entity/ExtraInformation.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 2 | import {EditHistory} from "./EditHistory.ts"; 3 | 4 | export class ExtraInformation { 5 | 6 | @Column(type => EditHistory) 7 | lastEdit!: EditHistory; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/functional/mongodb/basic/embedded-columns/entity/Information.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Information { 4 | 5 | @Column({ type: String }) 6 | description!: string; 7 | 8 | @Column({ type: Boolean }) 9 | visible!: boolean; 10 | 11 | @Column({ type: Boolean }) 12 | editable!: boolean; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/mongodb/basic/mongo-embeddeds-index/entity/Information.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 2 | import {Index} from "../../../../../../src/decorator/Index.ts"; 3 | 4 | export class Information { 5 | 6 | @Column({ type: String }) 7 | description!: string; 8 | 9 | @Column({ type: Number }) 10 | @Index("post_likes") 11 | likes!: number; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/functional/ormconfigs/all/ormconfig.env: -------------------------------------------------------------------------------- 1 | TYPEORM_HOST = localhost 2 | TYPEORM_USERNAME = root 3 | TYPEORM_PASSWORD = admin 4 | TYPEORM_PORT = 3000 5 | TYPEORM_LOGGING = true -------------------------------------------------------------------------------- /test/functional/ormconfigs/all/ormconfig.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "default", 3 | host: "localhost", 4 | username: "root", 5 | password: "admin", 6 | port: 3000, 7 | logging: true 8 | }; -------------------------------------------------------------------------------- /test/functional/ormconfigs/all/ormconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | localhost 4 | root 5 | admin 6 | 3000 7 | true 8 | 9 | -------------------------------------------------------------------------------- /test/functional/ormconfigs/all/ormconfig.yml: -------------------------------------------------------------------------------- 1 | default: 2 | host: localhost 3 | username: root 4 | password: admin 5 | port: 3000 6 | logging: true -------------------------------------------------------------------------------- /test/functional/persistence/partial-persist/entity/Counters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Counters { 4 | 5 | @Column({ type: Number }) 6 | stars!: number; 7 | 8 | @Column({ type: Number }) 9 | commentCount!: number; 10 | 11 | @Column({ type: String }) 12 | metadata!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/delete/entity/Counters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Counters { 4 | 5 | @Column({ default: 1, type: Number }) 6 | likes!: number; 7 | 8 | @Column({ nullable: true, type: Number }) 9 | favorites!: number; 10 | 11 | @Column({ default: 0, type: Number }) 12 | comments!: number; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/delete/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class User { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/distinct-on/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class User { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/enabling-transaction/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/insert-on-conflict/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryColumn} from "../../../../../src/decorator/columns/PrimaryColumn.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryColumn({ type: String }) 9 | id!: string; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/insert/entity/Counters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Counters { 4 | 5 | @Column({ default: 1, type: Number }) 6 | likes!: number; 7 | 8 | @Column({ nullable: true, type: Number }) 9 | favorites!: number; 10 | 11 | @Column({ default: 0, type: Number }) 12 | comments!: number; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/insert/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/insert/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class User { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/join/entity/Tag.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Tag { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/join/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class User { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/relation-id/many-to-many/embedded/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../../../../src/decorator/columns/Column.ts"; 3 | import {Counters} from "./Counters.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @Column({ type: String }) 9 | title!: string; 10 | 11 | @Column(() => Counters, { prefix: "cnt" }) 12 | counters!: Counters; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/relation-id/many-to-one/embedded-with-multiple-pk/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryColumn} from "../../../../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | 4 | @Entity() 5 | export class Category { 6 | 7 | @PrimaryColumn({ type: Number }) 8 | id!: number; 9 | 10 | @PrimaryColumn({ type: String }) 11 | name!: string; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/functional/query-builder/relation-id/many-to-one/embedded-with-multiple-pk/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryColumn} from "../../../../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | 4 | @Entity() 5 | export class User { 6 | 7 | @PrimaryColumn({ type: Number }) 8 | id!: number; 9 | 10 | @PrimaryColumn({ type: String }) 11 | name!: string; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/functional/query-builder/relation-id/many-to-one/embedded/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../../../../src/decorator/columns/Column.ts"; 3 | import {Counters} from "./Counters.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @Column({ type: String }) 9 | title!: string; 10 | 11 | @Column(() => Counters) 12 | counters!: Counters; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/relation-id/one-to-many/embedded/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../../../../src/decorator/columns/Column.ts"; 3 | import {Counters} from "./Counters.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @Column({ type: String }) 9 | title!: string; 10 | 11 | @Column(() => Counters) 12 | counters!: Counters; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/relation-id/one-to-one/embedded-with-multiple-pk/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryColumn} from "../../../../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | 4 | @Entity() 5 | export class Category { 6 | 7 | @PrimaryColumn({ type: Number }) 8 | id!: number; 9 | 10 | @PrimaryColumn({ type: String }) 11 | name!: string; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/functional/query-builder/relation-id/one-to-one/embedded-with-multiple-pk/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryColumn} from "../../../../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | 4 | @Entity() 5 | export class User { 6 | 7 | @PrimaryColumn({ type: Number }) 8 | id!: number; 9 | 10 | @PrimaryColumn({ type: String }) 11 | name!: string; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/functional/query-builder/relation-id/one-to-one/embedded/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../../../../src/decorator/columns/Column.ts"; 3 | import {Counters} from "./Counters.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @Column({ type: String }) 9 | title!: string; 10 | 11 | @Column(() => Counters) 12 | counters!: Counters; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/subquery/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-builder/update/entity/Counters.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Counters { 4 | 5 | @Column({ default: 1, type: Number }) 6 | likes!: number; 7 | 8 | @Column({ nullable: true, type: Number }) 9 | favorites!: number; 10 | 11 | @Column({ default: 0, type: Number }) 12 | comments!: number; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/query-runner/entity/Book.ts: -------------------------------------------------------------------------------- 1 | import { PrimaryColumn } from "../../../../src/decorator/columns/PrimaryColumn.ts"; 2 | import { Entity } from "../../../../src/decorator/entity/Entity.ts"; 3 | 4 | @Entity() 5 | export class Book { 6 | 7 | @PrimaryColumn({ type: String }) 8 | ean!: string; 9 | 10 | } 11 | 12 | @Entity({ withoutRowid: true }) 13 | export class Book2 { 14 | 15 | @PrimaryColumn({ type: String }) 16 | ean!: string; 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /test/functional/query-runner/entity/Faculty.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 4 | 5 | @Entity() 6 | export class Faculty { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/relations/relation-mapped-to-different-name-column/entity/PostDetails.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryColumn} from "../../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | 4 | @Entity() 5 | export class PostDetails { 6 | 7 | @PrimaryColumn({ type: String }) 8 | keyword!: string; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /test/functional/repository/basic-methods/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/repository/basic-methods/model/Question.ts: -------------------------------------------------------------------------------- 1 | export interface Question { 2 | id?: number; 3 | title?: string; 4 | type: string; 5 | } -------------------------------------------------------------------------------- /test/functional/repository/basic-methods/model/User.ts: -------------------------------------------------------------------------------- 1 | export interface User { 2 | id?: number|null; 3 | firstName?: string; 4 | secondName?: string; 5 | } -------------------------------------------------------------------------------- /test/functional/repository/basic-methods/schema/user.js: -------------------------------------------------------------------------------- 1 | export default { 2 | "name": "User", 3 | "table": { 4 | "name": "user" 5 | }, 6 | "columns": { 7 | "id": { 8 | "type": "int", 9 | "primary": true, 10 | "generated": true 11 | }, 12 | "firstName": { 13 | "type": "varchar", 14 | "nullable": false 15 | }, 16 | "secondName": { 17 | "type": "varchar", 18 | "nullable": false 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/functional/repository/clear/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryColumn} from "../../../../../src/decorator/columns/PrimaryColumn.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryColumn("int") 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/repository/delete-by-id-and-ids/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/repository/find-methods/model/User.ts: -------------------------------------------------------------------------------- 1 | export interface User { 2 | id: number; 3 | firstName: string; 4 | secondName: string; 5 | } 6 | -------------------------------------------------------------------------------- /test/functional/repository/find-options-operators/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ nullable: true, type: String }) 10 | title!: string; 11 | 12 | @Column({ type: Number }) 13 | likes!: number; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /test/functional/repository/find-options-relations/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class User { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/repository/find-options/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/repository/find-options/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class User { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/schema-builder/entity/Album.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryColumn} from "../../../../src/decorator/columns/PrimaryColumn.ts"; 4 | 5 | @Entity({ synchronize: false }) 6 | export class Album { 7 | 8 | @PrimaryColumn({ type: Number }) 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/schema-builder/entity/Faculty.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 4 | 5 | @Entity() 6 | export class Faculty { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/schema-builder/entity/Question.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 4 | 5 | @Entity() 6 | export class Question { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/sqljs/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryColumn} from "../../../../src/decorator/columns/PrimaryColumn.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryColumn({ type: Number }) 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | } 14 | -------------------------------------------------------------------------------- /test/functional/sqljs/sqlite/test.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denolib/typeorm/5024967ef8797627f3fcc8a975df52fc92192c2c/test/functional/sqljs/sqlite/test.sqlite -------------------------------------------------------------------------------- /test/functional/table-inheritance/extending/entity/Content.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 2 | import {Unit} from "./Unit.ts"; 3 | 4 | export class Content extends Unit { 5 | 6 | @Column({ type: String }) 7 | name!: string; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/functional/table-inheritance/extending/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 3 | import {Content} from "./Content.ts"; 4 | 5 | @Entity() 6 | export class Post extends Content { 7 | 8 | @Column({ type: String }) 9 | text!: string; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/table-inheritance/extending/entity/Unit.ts: -------------------------------------------------------------------------------- 1 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 2 | 3 | export class Unit { 4 | 5 | @PrimaryGeneratedColumn() 6 | id!: number; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /test/functional/table-inheritance/single-table/basic-functionality/entity/Accountant.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 2 | import {ChildEntity} from "../../../../../../src/decorator/entity/ChildEntity.ts"; 3 | import {Employee} from "./Employee.ts"; 4 | 5 | @ChildEntity() 6 | export class Accountant extends Employee { 7 | 8 | @Column({ type: String }) 9 | department!: string; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/table-inheritance/single-table/basic-functionality/entity/Employee.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 2 | import {ChildEntity} from "../../../../../../src/decorator/entity/ChildEntity.ts"; 3 | import {Person} from "./Person.ts"; 4 | 5 | @ChildEntity() 6 | export class Employee extends Person { 7 | 8 | @Column({ type: Number }) 9 | salary!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/table-inheritance/single-table/basic-functionality/entity/Student.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 2 | import {ChildEntity} from "../../../../../../src/decorator/entity/ChildEntity.ts"; 3 | import {Person} from "./Person.ts"; 4 | 5 | @ChildEntity() 6 | export class Student extends Person { 7 | 8 | @Column({ type: String }) 9 | faculty!: string; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/table-inheritance/single-table/basic-functionality/entity/Teacher.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 2 | import {ChildEntity} from "../../../../../../src/decorator/entity/ChildEntity.ts"; 3 | import {Employee} from "./Employee.ts"; 4 | 5 | @ChildEntity() 6 | export class Teacher extends Employee { 7 | 8 | @Column({ type: String }) 9 | specialization!: string; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/table-inheritance/single-table/database-option-inherited/entity/Employee.ts: -------------------------------------------------------------------------------- 1 | import {ChildEntity, Column} from "../../../../../../src/index.ts"; 2 | 3 | import {Person} from "./Person.ts"; 4 | 5 | @ChildEntity() 6 | export class Employee extends Person { 7 | 8 | @Column({ type: Number }) 9 | salary!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/table-inheritance/single-table/database-option-inherited/entity/Person.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn, TableInheritance} from "../../../../../../src/index.ts"; 2 | 3 | @Entity({database: "test"}) 4 | @TableInheritance({column: {name: "type", type: "varchar"}}) 5 | export class Person { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | name!: string; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/functional/table-inheritance/single-table/non-virtual-discriminator-column/entity/Employee.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 2 | import {ChildEntity} from "../../../../../../src/decorator/entity/ChildEntity.ts"; 3 | import {Person} from "./Person.ts"; 4 | 5 | @ChildEntity("employee-type") 6 | export class Employee extends Person { 7 | 8 | @Column({ type: Number }) 9 | salary!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/table-inheritance/single-table/non-virtual-discriminator-column/entity/Student.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../src/decorator/columns/Column.ts"; 2 | import {ChildEntity} from "../../../../../../src/decorator/entity/ChildEntity.ts"; 3 | import {Person} from "./Person.ts"; 4 | 5 | @ChildEntity("student-type") 6 | export class Student extends Person { 7 | 8 | @Column({ type: String }) 9 | faculty!: string; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/table-inheritance/single-table/relations/many-to-many/entity/Employee.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../../src/decorator/columns/Column.ts"; 2 | import {ChildEntity} from "../../../../../../../src/decorator/entity/ChildEntity.ts"; 3 | import {Person} from "./Person.ts"; 4 | 5 | @ChildEntity() 6 | export class Employee extends Person { 7 | 8 | @Column({ type: Number }) 9 | salary!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/table-inheritance/single-table/relations/one-to-many/entity/Employee.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../../../../src/decorator/columns/Column.ts"; 2 | import {ChildEntity} from "../../../../../../../src/decorator/entity/ChildEntity.ts"; 3 | import {Person} from "./Person.ts"; 4 | 5 | @ChildEntity() 6 | export class Employee extends Person { 7 | 8 | @Column({ type: Number }) 9 | salary!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/functional/transaction/transaction-decorator/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/uuid/cockroach/entity/Record.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | 4 | @Entity() 5 | export class Record { 6 | 7 | @PrimaryGeneratedColumn("uuid") 8 | id!: string; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /test/functional/uuid/postgres/entity/Record.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | 4 | @Entity() 5 | export class Record { 6 | 7 | @PrimaryGeneratedColumn("uuid") 8 | id!: string; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /test/functional/view-entity/general/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/index.ts"; 2 | import {Column} from "../../../../../src/index.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../../src/index.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/view-entity/mssql/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/index.ts"; 2 | import {Column} from "../../../../../src/index.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../../src/index.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/view-entity/mysql/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/index.ts"; 2 | import {Column} from "../../../../../src/index.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../../src/index.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/view-entity/oracle/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/index.ts"; 2 | import {Column} from "../../../../../src/index.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../../src/index.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/view-entity/postgres/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/index.ts"; 2 | import {Column} from "../../../../../src/index.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../../src/index.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/functional/view-entity/sqlite/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../../src/index.ts"; 2 | import {Column} from "../../../../../src/index.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../../src/index.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/1014/entity/TestEntity.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 4 | 5 | @Entity() 6 | export class TestEntity { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/1042/entity/Information.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Information { 4 | 5 | @Column({ type: String }) 6 | maritalStatus!: string; 7 | 8 | @Column({ type: String }) 9 | gender!: string; 10 | 11 | @Column({ type: String }) 12 | address!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/1042/entity/Profile.ts: -------------------------------------------------------------------------------- 1 | export class Profile { 2 | 3 | firstName!: string; 4 | lastName!: string; 5 | age!: number; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /test/github-issues/108/entity/Project.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Project { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ unique: true, type: String }) 12 | name!: string; 13 | } 14 | -------------------------------------------------------------------------------- /test/github-issues/108/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class User { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ unique: true, type: String }) 12 | name!: string; 13 | } 14 | -------------------------------------------------------------------------------- /test/github-issues/1099/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Category { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/github-issues/1118/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | name!: string; 11 | } 12 | -------------------------------------------------------------------------------- /test/github-issues/1139/entity/User.ts: -------------------------------------------------------------------------------- 1 | import { Entity } from "../../../../src/decorator/entity/Entity.ts"; 2 | import { PrimaryGeneratedColumn } from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | 4 | @Entity() 5 | export class User { 6 | @PrimaryGeneratedColumn("uuid") 7 | id!: string; 8 | } 9 | -------------------------------------------------------------------------------- /test/github-issues/1147/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | title!: string; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/github-issues/1178/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {User} from "./User.ts"; 3 | import {ManyToOne} from "../../../../src/decorator/relations/ManyToOne.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | @ManyToOne(type => User) 15 | user!: User; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /test/github-issues/1178/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | name!: string; 11 | } 12 | -------------------------------------------------------------------------------- /test/github-issues/1245/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | name!: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1259/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Category { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/github-issues/1261/entity/Foo.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {BaseEntity} from "../../../../src/repository/BaseEntity.ts"; 4 | 5 | @Entity() 6 | export class Foo extends BaseEntity { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/github-issues/1282/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Category { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/github-issues/131/entity/Employee.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | import {Person} from "./Person.ts"; 3 | import {ChildEntity} from "../../../../src/decorator/entity/ChildEntity.ts"; 4 | 5 | @ChildEntity() 6 | export class Employee extends Person { 7 | 8 | @Column({ type: Number }) 9 | salary!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/github-issues/131/entity/Student.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | import {Person} from "./Person.ts"; 3 | import {ChildEntity} from "../../../../src/decorator/entity/ChildEntity.ts"; 4 | 5 | @ChildEntity() 6 | export class Student extends Person { 7 | 8 | @Column({ type: String }) 9 | faculty!: string; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/github-issues/1326/entity/SpecificUser.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity("user", { database: "db_2" }) 4 | export class SpecificUser { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | name!: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1326/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity({ database: "db_1" }) 4 | export class User { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | name!: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1369/entity/AbstractEntity.ts: -------------------------------------------------------------------------------- 1 | import {Column, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | export abstract class AbstractEntity { 4 | @PrimaryGeneratedColumn() id!: number; 5 | @Column({ type: String }) firstname!: string; 6 | @Column({ type: String }) lastname!: string; 7 | @Column({ type: String }) fullname!: string; 8 | } 9 | -------------------------------------------------------------------------------- /test/github-issues/1369/entity/ConcreteEntity.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity} from "../../../../src/index.ts"; 2 | import {AbstractEntity} from "./AbstractEntity.ts"; 3 | 4 | @Entity() 5 | export class ConcreteEntity extends AbstractEntity { 6 | @Column({ type: String }) position!: string; 7 | } 8 | -------------------------------------------------------------------------------- /test/github-issues/1388/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: "timestamp", nullable: true }) 10 | createdAt!: Date; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1397/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | title!: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1416/entity/Author.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn, OneToMany} from "../../../../src/index.ts"; 2 | import {Photo} from "./Photo.ts"; 3 | 4 | @Entity() 5 | export class Author { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | name!: string; 12 | 13 | @OneToMany(type => Photo, photo => photo.author) 14 | photos!: Photo[]; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /test/github-issues/1427/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({type: "decimal", precision: 10, scale: 6}) 10 | qty!: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1476/entity/Item.ts: -------------------------------------------------------------------------------- 1 | import { Entity, PrimaryColumn, Column } from "../../../../src/index.ts"; 2 | 3 | 4 | @Entity() 5 | export class Item { 6 | @PrimaryColumn({ type: Number }) 7 | itemId!: number; 8 | 9 | @Column({ type: Number }) 10 | planId!: number; 11 | } 12 | -------------------------------------------------------------------------------- /test/github-issues/1476/entity/Plan.ts: -------------------------------------------------------------------------------- 1 | import { Entity, PrimaryColumn, Column } from "../../../../src/index.ts"; 2 | 3 | 4 | @Entity() 5 | export class Plan { 6 | @PrimaryColumn({ type: Number }) 7 | planId!: number; 8 | 9 | @Column({ type: String }) 10 | planName!: string; 11 | } 12 | -------------------------------------------------------------------------------- /test/github-issues/1504/entity/TestEntity1.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {TestEntity2} from "./TestEntity2.ts"; 3 | 4 | @Entity() 5 | export class TestEntity1 { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) name!: string; 11 | 12 | @OneToOne(t => TestEntity2, a => a.Entity1) 13 | @JoinColumn() 14 | Entity2!: TestEntity2; 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/1504/entity/TestEntity4.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, ManyToOne, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {TestEntity3} from "./TestEntity3.ts"; 3 | 4 | @Entity() 5 | export class TestEntity4 { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | name!: string; 12 | 13 | @ManyToOne(t => TestEntity3, entity3 => entity3.Entity4) 14 | Entity3!: TestEntity3; 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/151/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/1545/entity/MainModel.ts: -------------------------------------------------------------------------------- 1 | import { Entity, PrimaryGeneratedColumn, OneToMany } from "../../../../src/index.ts"; 2 | import { DataModel } from "./DataModel.ts"; 3 | 4 | @Entity() 5 | export class MainModel { 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @OneToMany( 10 | type => DataModel, 11 | dataModel => dataModel.main, 12 | {cascade: true, eager: true} 13 | ) 14 | dataModel!: DataModel[]; 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/1545/entity/ValidationModel.ts: -------------------------------------------------------------------------------- 1 | import { Column, OneToMany, Entity } from "../../../../src/index.ts"; 2 | import { DataModel } from "./DataModel.ts"; 3 | 4 | @Entity() 5 | export class ValidationModel { 6 | @Column({ 7 | type: "integer", 8 | primary: true 9 | }) 10 | validation!: number; 11 | 12 | @OneToMany( 13 | type => DataModel, 14 | dataModel => dataModel.validations 15 | ) 16 | dataModel!: DataModel[]; 17 | } 18 | -------------------------------------------------------------------------------- /test/github-issues/1576/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Column, PrimaryGeneratedColumn, Entity} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Category { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | name!: string; 11 | 12 | @Column({ type: String }) 13 | name2!: string; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/1581/entity/DeliverySlot.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class DeliverySlot { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | name!: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1581/entity/Product.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Product { 5 | 6 | @Column({ type: Number, primary: true }) 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | name!: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1581/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, OneToMany, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {Order} from "./Order.ts"; 3 | 4 | @Entity() 5 | export class User { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String, unique: true }) 11 | email!: string; 12 | 13 | @OneToMany(type => Order, recurringOrder => recurringOrder.user) 14 | recurringOrders!: Order[]; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /test/github-issues/1591/entity/Photo.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Photo { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | name!: string; 11 | 12 | @Column({ type: Date }) 13 | date!: Date; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/1591/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, JoinTable, ManyToMany, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {Photo} from "./Photo.ts"; 3 | 4 | @Entity() 5 | export class User { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | name!: string; 12 | 13 | @ManyToMany(type => Photo) 14 | @JoinTable() 15 | photos!: Photo[]; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /test/github-issues/1600/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column("varchar", { array: true }) 10 | names!: string[]; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1615/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity("Foo") 4 | export class FooEntity { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column("datetime2", { precision: 0 }) 10 | date!: Date; 11 | } 12 | -------------------------------------------------------------------------------- /test/github-issues/1623/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | firstName!: string; 11 | 12 | @Column({ type: String }) 13 | lastName!: string; 14 | 15 | @Column({ type: Number }) 16 | age!: number; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /test/github-issues/1652/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryColumn, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @PrimaryColumn({ type: String }) 10 | name!: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1656/entity/A.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class A { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/1656/entity/B.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class B { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/1656/entity/C.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class C { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/1680/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity, Column, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String, unique: true }) 10 | name!: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1685/entity/user.ts: -------------------------------------------------------------------------------- 1 | import {PrimaryColumn, Entity, OneToMany} from "../../../../src/index.ts"; 2 | import {UserMonth} from "./user-month.ts"; 3 | 4 | @Entity() 5 | export class User { 6 | 7 | @PrimaryColumn({ type: String }) 8 | public username!: string; 9 | 10 | @OneToMany(type => UserMonth, userMonth => userMonth.user) 11 | public userMonths!: UserMonth[]; 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1685/entity/year.ts: -------------------------------------------------------------------------------- 1 | import {PrimaryColumn, Entity, OneToMany} from "../../../../src/index.ts"; 2 | import {Month} from "./month.ts"; 3 | 4 | @Entity() 5 | export class Year { 6 | 7 | @PrimaryColumn({ type: Number }) 8 | public yearNo!: number; 9 | 10 | @OneToMany(type => Month, month => month.yearNo) 11 | public month!: Month[]; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/github-issues/1703/entity/UserEntity.ts: -------------------------------------------------------------------------------- 1 | import {Entity, OneToMany, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {UserToOrganizationEntity} from "./UserToOrganizationEntity.ts"; 3 | 4 | @Entity("user") 5 | export class UserEntity { 6 | 7 | @PrimaryGeneratedColumn() 8 | id?: number; 9 | 10 | @OneToMany(type => UserToOrganizationEntity, userToOrganization => userToOrganization.user) 11 | organizations!: UserToOrganizationEntity[]; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/github-issues/1716/entity/mariadbEntity.ts: -------------------------------------------------------------------------------- 1 | import { PrimaryColumn, Entity, Column } from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class MariadbEntity { 5 | 6 | @PrimaryColumn({ type: Number }) 7 | id!: number; 8 | 9 | @Column("time") 10 | fieldTime!: Date; 11 | 12 | @Column("timestamp") 13 | fieldTimestamp!: Date; 14 | 15 | @Column("datetime") 16 | fieldDatetime!: Date; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /test/github-issues/1716/entity/mysqlEntity.ts: -------------------------------------------------------------------------------- 1 | import { PrimaryColumn, Entity, Column } from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class MysqlEntity { 5 | 6 | @PrimaryColumn({ type: Number }) 7 | id!: number; 8 | 9 | @Column("time") 10 | fieldTime!: Date; 11 | 12 | @Column("timestamp") 13 | fieldTimestamp!: Date; 14 | 15 | @Column("datetime") 16 | fieldDatetime!: Date; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /test/github-issues/1720/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {AfterLoad, Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Category { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | name!: string; 11 | 12 | loaded: boolean = false; 13 | 14 | @AfterLoad() 15 | printMessage() { 16 | this.loaded = true; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /test/github-issues/1733/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | name!: string; 11 | 12 | @Column({ type: String, length: 255 }) 13 | name2!: string; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/174/entity/Contact.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Contact { 4 | 5 | @Column({ type: String }) 6 | name!: string; 7 | 8 | @Column({ type: String }) 9 | email!: string; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/github-issues/1749/entity/Bar.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/index.ts"; 3 | 4 | @Entity("bar", { schema: "foo" }) 5 | export class Bar { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: string; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /test/github-issues/1751/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | 6 | @PrimaryGeneratedColumn() 7 | id = undefined; 8 | 9 | @Column("varchar") 10 | email = ""; 11 | 12 | @Column("varchar") 13 | avatarURL = ""; 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/1754/entity/tipo-cliente.ts: -------------------------------------------------------------------------------- 1 | import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from "../../../../src/index.ts"; 2 | import { Cliente } from "./cliente.ts"; 3 | 4 | @Entity() 5 | export class TipoCliente { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({type: String, name: "tipo"}) 11 | descricao!: string; 12 | 13 | @OneToMany(() => Cliente, c => c.tipo) 14 | clientes!: Cliente[]; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /test/github-issues/1758/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/github-issues/1788/entity/Personalization.ts: -------------------------------------------------------------------------------- 1 | import { Column, Entity, PrimaryGeneratedColumn } from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Personalization { 5 | @PrimaryGeneratedColumn("uuid") public id!: number; 6 | 7 | @Column({ type: String }) public logo!: string; 8 | } 9 | -------------------------------------------------------------------------------- /test/github-issues/1805/entity/Account.ts: -------------------------------------------------------------------------------- 1 | import {BaseEntity, Entity, PrimaryColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity("accounts") 4 | export class Account extends BaseEntity { 5 | 6 | @PrimaryColumn("bigint") 7 | id!: string; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/github-issues/182/model/PostStatus.ts: -------------------------------------------------------------------------------- 1 | export enum PostStatus { 2 | NEW = 0, 3 | ACTIVE = 1, 4 | ACHIEVED = 2 5 | } -------------------------------------------------------------------------------- /test/github-issues/1839/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryColumn} from "../../../../src/index.ts"; 2 | import {ManyToMany} from "../../../../src/decorator/relations/ManyToMany.ts"; 3 | import {Post} from "./Post.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryColumn({ type: String, collation: "ascii_general_ci", charset: "ascii" }) 9 | id!: string; 10 | 11 | @ManyToMany(type => Post, post => post.categories) 12 | posts!: Post[]; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/1883/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {FruitEnum} from "../enum/FruitEnum.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column("enum", { enum: FruitEnum, default: FruitEnum.Apple }) 12 | fruit!: FruitEnum; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/1883/enum/FruitEnum.ts: -------------------------------------------------------------------------------- 1 | export enum FruitEnum { 2 | Apple = "apple", 3 | Pineapple = "pineapple", 4 | Banana = "banana" 5 | } -------------------------------------------------------------------------------- /test/github-issues/190/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/1901/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | 4 | @Entity() 5 | export class Post { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column("timestamp", { precision: 3, default: () => "CURRENT_TIMESTAMP(3)", onUpdate: "CURRENT_TIMESTAMP(3)"}) 11 | updateAt!: Date; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/github-issues/1972/entity/TournamentParticipant.ts: -------------------------------------------------------------------------------- 1 | import { Entity, TableInheritance, PrimaryGeneratedColumn } from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | @TableInheritance({ 5 | pattern: "STI", 6 | column: { 7 | name: "type", 8 | type: "varchar", 9 | }, 10 | }) 11 | export abstract class TournamentParticipant { 12 | @PrimaryGeneratedColumn() 13 | public id!: number; 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/1972/entity/User.ts: -------------------------------------------------------------------------------- 1 | import { Entity, PrimaryGeneratedColumn, Column } from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | @PrimaryGeneratedColumn() 6 | public id!: number; 7 | 8 | @Column({ type: String }) 9 | public name!: string; 10 | 11 | constructor(user?: { name: string }) { 12 | if (user) { 13 | this.name = user.name; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/github-issues/1981/entity/Product.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Product { 5 | 6 | @PrimaryGeneratedColumn("uuid") 7 | id!: string; 8 | 9 | @Column({ type: Boolean }) 10 | liked!: boolean; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/1997/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import { Column, Entity, PrimaryGeneratedColumn } from "../../../../src/index.ts"; 2 | 3 | @Entity({schema: "schema"}) 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column("enum", { enum: ["A", "B", "C"] }) 10 | enum!: string; 11 | 12 | @Column({ type: String }) 13 | name!: string; 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/2005/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ 10 | type: "tinyint", 11 | transformer: { 12 | from: val => !!val, 13 | to: val => val, 14 | }, 15 | }) 16 | activated!: boolean; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /test/github-issues/2006/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column("varchar", { nullable: true }) 10 | token: string | null = null; 11 | 12 | @Column({ 13 | type: "tinyint", 14 | default: 0, 15 | width: 1 16 | }) 17 | dnd: boolean = false; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /test/github-issues/204/entity/RecordConfig.ts: -------------------------------------------------------------------------------- 1 | export interface RecordConfig { 2 | 3 | id: number; 4 | option1: string; 5 | option2: string; 6 | option3: string; 7 | isActive: boolean; 8 | extra: { 9 | data1: string; 10 | data2: string; 11 | }; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/github-issues/204/entity/RecordData.ts: -------------------------------------------------------------------------------- 1 | export class RecordData { 2 | 3 | constructor(public data1: string, 4 | public data2: string, 5 | public data3: string, 6 | public data4: string, 7 | public isActive: boolean, 8 | public isReadonly: boolean) { 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/github-issues/2067/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/github-issues/2103/entity/Complex.ts: -------------------------------------------------------------------------------- 1 | import {Entity, Column, PrimaryColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Complex { 5 | 6 | @PrimaryColumn({ type: Number }) 7 | id!: number; 8 | 9 | @PrimaryColumn({ type: Number }) 10 | code!: number; 11 | 12 | @Column({ type: Number }) 13 | x!: number; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/2103/entity/Simple.ts: -------------------------------------------------------------------------------- 1 | import {Entity, Column, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Simple { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: Number }) 10 | x!: number; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/2128/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import { PrimaryGeneratedColumn, Entity, Column } from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | title!: string; 11 | 12 | @Column({ 13 | type: "json" 14 | }) 15 | meta!: any; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /test/github-issues/215/entity/Abbreviation.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Abbreviation { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/215/entity/Author.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Author { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/2199/entity/Bar.ts: -------------------------------------------------------------------------------- 1 | import { Column, PrimaryGeneratedColumn } from "../../../../src/index.ts"; 2 | import { Entity } from "../../../../src/decorator/entity/Entity.ts"; 3 | 4 | @Entity("bar") 5 | export class Bar { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | description!: string; 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/2200/entity/Booking.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn, ManyToOne, JoinColumn} from "../../../../src/index.ts"; 2 | import { Contact } from "./Contact.ts"; 3 | 4 | @Entity() 5 | export class Booking { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @ManyToOne(type => Contact, contact => contact.bookings, { eager: true }) 11 | @JoinColumn({ 12 | name: "contact_id", 13 | }) 14 | contact!: Contact; 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/2200/entity/Contact.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn, OneToMany} from "../../../../src/index.ts"; 2 | import { Booking } from "./Booking.ts"; 3 | 4 | @Entity() 5 | export class Contact { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @OneToMany(type => Booking, booking => booking.contact) 11 | bookings!: Booking[]; 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/2251/entity/Bar.ts: -------------------------------------------------------------------------------- 1 | import { Column, ManyToOne, PrimaryGeneratedColumn } from "../../../../src/index.ts"; 2 | import { Entity } from "../../../../src/decorator/entity/Entity.ts"; 3 | import { Foo } from "./Foo.ts"; 4 | 5 | @Entity() 6 | export class Bar { 7 | @PrimaryGeneratedColumn() id!: number; 8 | 9 | @Column({ type: String }) description!: string; 10 | 11 | @ManyToOne(type => Foo, foo => foo.bars) 12 | foo?: Foo; 13 | } 14 | -------------------------------------------------------------------------------- /test/github-issues/2287/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | 4 | @Entity() 5 | export class Post { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column("int", { array: true, nullable: true}) 11 | skill_id_array!: number[]; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/github-issues/2313/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {BaseEntity, Entity, PrimaryGeneratedColumn, Column} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post extends BaseEntity { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: Number }) 10 | data!: number; 11 | } 12 | -------------------------------------------------------------------------------- /test/github-issues/2364/entity/dummy.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 3 | 4 | @Entity() 5 | export class Dummy { 6 | @Column("integer", { 7 | generated: true, 8 | nullable: false, 9 | primary: true, 10 | }) 11 | id!: number; 12 | 13 | @Column({ type: String, default: "name" }) 14 | name!: string; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /test/github-issues/2364/entity/dummy2.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column, PrimaryColumn} from "../../../../src/index.ts"; 3 | 4 | @Entity() 5 | export class Dummy2 { 6 | @PrimaryColumn("integer", { 7 | generated: true, 8 | nullable: false, 9 | primary: true, 10 | }) 11 | id!: number; 12 | 13 | @Column({ type: String, default: "name" }) 14 | name!: string; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /test/github-issues/2499/entity/Foo.ts: -------------------------------------------------------------------------------- 1 | import {Column, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 3 | 4 | @Entity("foo") 5 | export class Foo { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | description!: string; 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/2557/transformer.ts: -------------------------------------------------------------------------------- 1 | export class WrappedNumber { 2 | constructor (private wrapped: number) {} 3 | 4 | getWrapped(): number { 5 | return this.wrapped; 6 | } 7 | } 8 | 9 | export const transformer = { 10 | lastValue : undefined as any, 11 | from(val: number) { 12 | return new WrappedNumber(val); 13 | }, 14 | to(w: WrappedNumber) { 15 | transformer.lastValue = w; 16 | return w.getWrapped(); 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /test/github-issues/2693/entity/user.ts: -------------------------------------------------------------------------------- 1 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 2 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 3 | 4 | @Entity({name: "users", synchronize: false}) 5 | export class User { 6 | @PrimaryGeneratedColumn("uuid") 7 | id!: number; 8 | } 9 | -------------------------------------------------------------------------------- /test/github-issues/2779/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import { Column, Entity, PrimaryGeneratedColumn } from "../../../../src/index.ts"; 2 | import { Role } from "../set.ts"; 3 | 4 | @Entity("post") 5 | export class Post { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column("set", { 11 | default: [Role.Admin, Role.Developer], 12 | enum: Role 13 | }) 14 | roles!: Role[]; 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/2779/set.ts: -------------------------------------------------------------------------------- 1 | export enum Role { 2 | Admin = "Admin", 3 | Support = "Support", 4 | Developer = "Developer" 5 | } -------------------------------------------------------------------------------- /test/github-issues/2800/entity/Vehicle.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn, TableInheritance} from "../../../../src/index.ts"; 2 | 3 | export abstract class Engine {} 4 | 5 | @Entity() 6 | @TableInheritance({ column: { name: "type", type: "varchar" }}) 7 | export abstract class Vehicle { 8 | 9 | @PrimaryGeneratedColumn() 10 | public id?: number; 11 | 12 | public abstract engine: Engine; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/2871/documentEnum.ts: -------------------------------------------------------------------------------- 1 | export enum DocumentEnum { 2 | NONE = "", 3 | DOCUMENT_A = "DOCUMENT_A", 4 | DOCUMENT_B = "DOCUMENT_B", 5 | DOCUMENT_C = "DOCUMENT_C", 6 | DOCUMENT_D = "DOCUMENT_D", 7 | } -------------------------------------------------------------------------------- /test/github-issues/2965/entity/note.ts: -------------------------------------------------------------------------------- 1 | import { Entity, Column, ManyToOne, PrimaryGeneratedColumn } from "../../../../src/index.ts"; 2 | import { Person } from "./person.ts"; 3 | 4 | @Entity() 5 | export class Note { 6 | @PrimaryGeneratedColumn() 7 | public id!: number; 8 | 9 | @Column({ type: String }) 10 | public label!: string; 11 | 12 | @ManyToOne(type => Person, { lazy: true }) 13 | public owner!: Promise | Person; 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/2965/entity/person.ts: -------------------------------------------------------------------------------- 1 | import { Entity, Column, OneToMany, PrimaryGeneratedColumn } from "../../../../src/index.ts"; 2 | import { Note } from "./note.ts"; 3 | 4 | @Entity() 5 | export class Person { 6 | @PrimaryGeneratedColumn() 7 | public id!: number; 8 | 9 | @Column({ type: String }) 10 | public name!: string; 11 | 12 | @OneToMany(type => Note, note => note.owner, { lazy: true }) 13 | public notes!: Promise | Note[]; 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/300/entity/Duration.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Duration { 4 | 5 | @Column({ type: Number, nullable: true }) 6 | minutes!: number|null; 7 | 8 | @Column({ type: Number, nullable: true }) 9 | hours!: number|null; 10 | 11 | @Column({ type: Number, nullable: true }) 12 | days!: number|null; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/306/entity/Duration.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class Duration { 4 | 5 | @Column({ type: Number, name: "duration_minutes" }) 6 | durationMinutes!: number; 7 | 8 | @Column({ type: Number, name: "duration_hours" }) 9 | durationHours!: number; 10 | 11 | @Column({ type: Number, name: "duration_days" }) 12 | durationDays!: number; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/3142/entity/Contact.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/index.ts"; 2 | 3 | export class Contact { 4 | 5 | @Column({ type: String, unique: true }) 6 | email!: string; 7 | } 8 | -------------------------------------------------------------------------------- /test/github-issues/3349/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {PrimaryColumn} from "../../../../src/index.ts"; 2 | import {Column} from "../../../../src/index.ts"; 3 | import {Entity} from "../../../../src/index.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | @PrimaryColumn({ type: Number }) 8 | public id!: number; 9 | 10 | @Column({ type: Number }) 11 | public myField!: number; 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/3350/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/3352/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | import {PrimaryColumn} from "../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryColumn({ type: Number }) 9 | id!: number; 10 | 11 | @Column({ 12 | type: "text", 13 | }) 14 | text!: string; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /test/github-issues/3363/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import { PrimaryGeneratedColumn } from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 2 | import { Column } from "../../../../src/decorator/columns/Column.ts"; 3 | import { Entity } from "../../../../src/decorator/entity/Entity.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/3363/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 3 | import { PrimaryGeneratedColumn } from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/3374/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn("uuid") 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/3379/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Index, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {Column} from "../../../../src/index.ts"; 3 | import {Entity} from "../../../../src/index.ts"; 4 | 5 | @Index("name_index", ["name"]) 6 | @Entity() 7 | export class Post { 8 | 9 | @PrimaryGeneratedColumn() 10 | id!: number; 11 | 12 | @Column({ type: String }) 13 | name!: string; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/3496/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/index.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/index.ts"; 3 | import {Column, VersionColumn} from "../../../../src/index.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @VersionColumn({ type: Number }) 11 | version!: number; 12 | 13 | @Column({ type: "jsonb" }) 14 | problems!: object; 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/352/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryColumn} from "../../../../src/decorator/columns/PrimaryColumn.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryColumn("double precision") 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/3588/entity/mysql.ts: -------------------------------------------------------------------------------- 1 | import { Entity, PrimaryGeneratedColumn, Column } from "../../../../src/index.ts"; 2 | 3 | @Entity({ name: "Session" }) 4 | export class Session { 5 | 6 | @PrimaryGeneratedColumn() 7 | id?: number; 8 | 9 | @Column({ 10 | type: "timestamp", 11 | precision: 3, 12 | default: () => "CURRENT_TIMESTAMP(3)", 13 | onUpdate: "CURRENT_TIMESTAMP(3)", 14 | }) 15 | ts!: Date; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /test/github-issues/3604/entity/Author.ts: -------------------------------------------------------------------------------- 1 | import {PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {Entity} from "../../../../src/index.ts"; 3 | 4 | @Entity() 5 | export class Author { 6 | 7 | @PrimaryGeneratedColumn("uuid") 8 | id!: string; 9 | } 10 | -------------------------------------------------------------------------------- /test/github-issues/363/entity/Car.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Car { 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | name!: string; 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/363/entity/Fruit.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Fruit { 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | name!: string; 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/3694/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {FruitEnum} from "../enum/FruitEnum.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column("enum", { enum: FruitEnum, default: FruitEnum.Apple }) 12 | fruit!: FruitEnum; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/3694/enum/FruitEnum.ts: -------------------------------------------------------------------------------- 1 | export enum FruitEnum { 2 | Apple = "apple", 3 | Pineapple = "pineapple", 4 | Banana = "banana" 5 | } 6 | -------------------------------------------------------------------------------- /test/github-issues/3702/entity/LetterBox.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | 4 | @Entity() 5 | export class LetterBox { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: "point", srid: 4326 }) 11 | coord!: string; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/github-issues/3828/entity/Entity.ts: -------------------------------------------------------------------------------- 1 | import { Column, Entity, PrimaryGeneratedColumn } from "../../../../src/index.ts"; 2 | 3 | enum MyEntityEnum { 4 | Something = "SOMETHING", 5 | SomethingElse = "SOMETHING_ELSE" 6 | } 7 | 8 | @Entity({ name: "MyEntity" }) 9 | export class MyEntity { 10 | @PrimaryGeneratedColumn("uuid") 11 | id!: number; 12 | 13 | @Column("enum", { enum: MyEntityEnum }) 14 | myColumn!: MyEntityEnum; 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/3847/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Category { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/github-issues/3857/entity/Men.ts: -------------------------------------------------------------------------------- 1 | import {Person} from "./Person.ts"; 2 | import {ChildEntity, Column} from "../../../../src/index.ts"; 3 | 4 | @ChildEntity() 5 | export class Men extends Person { 6 | 7 | @Column("varchar") 8 | beardColor!: string; 9 | } 10 | -------------------------------------------------------------------------------- /test/github-issues/3857/entity/Person.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn, Column, TableInheritance} from "../../../../src/index.ts"; 2 | 3 | @Entity({schema: "custom"}) 4 | @TableInheritance({column: {type: "varchar", name: "type"}}) 5 | export abstract class Person { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column("varchar") 11 | name!: string; 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/3857/entity/Women.ts: -------------------------------------------------------------------------------- 1 | import {Person} from "./Person.ts"; 2 | import {ChildEntity, Column} from "../../../../src/index.ts"; 3 | 4 | @ChildEntity() 5 | export class Women extends Person { 6 | 7 | @Column("int") 8 | brassiereSize!: number; 9 | } 10 | -------------------------------------------------------------------------------- /test/github-issues/3949/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryColumn} from "../../../../src/decorator/columns/PrimaryColumn.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryColumn({ type: Number }) 9 | id!: number; 10 | 11 | @Column({ type: Date }) 12 | date!: Date; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/401/entity/Group.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 4 | 5 | @Entity() 6 | export class Group { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/4096/entity/User.ts: -------------------------------------------------------------------------------- 1 | import { Entity, PrimaryColumn, Column } from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | @PrimaryColumn({ type: String }) 6 | email!: string; 7 | 8 | @PrimaryColumn({ type: String }) 9 | username!: string; 10 | 11 | @Column({ type: String }) 12 | bio!: string; 13 | } 14 | -------------------------------------------------------------------------------- /test/github-issues/4106/entity/GenderEnum.ts: -------------------------------------------------------------------------------- 1 | export enum Gender { 2 | male = "male", 3 | female = "female" 4 | } 5 | -------------------------------------------------------------------------------- /test/github-issues/4185/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {PrimaryColumn} from "../../../../src/decorator/columns/PrimaryColumn.ts"; 2 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 3 | import {LoadEvent} from "../../../../src/subscriber/event/LoadEvent.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | @PrimaryColumn({ type: Number }) 8 | id!: number; 9 | 10 | simpleSubscriberSaw?: boolean; 11 | extendedSubscriberSaw?: LoadEvent; 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/4190/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn, Column} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Category { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | name!: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/4190/entity/Photo.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn, Column, ManyToOne} from "../../../../src/index.ts"; 2 | import {User} from "./User.ts"; 3 | 4 | @Entity() 5 | export class Photo { 6 | 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | url!: string; 12 | 13 | @ManyToOne("User", "photos") 14 | user!: User; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /test/github-issues/4190/entity/Profile.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn, Column} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Profile { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | gender!: string; 11 | 12 | @Column({ type: String }) 13 | photo!: string; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/4219/entity/Photo.ts: -------------------------------------------------------------------------------- 1 | import {Shim} from "../shim.ts"; 2 | 3 | @Shim.Entity() 4 | export class Photo { 5 | 6 | @Shim.PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Shim.Column({ type: String }) 10 | url!: string; 11 | 12 | user!: any; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/4220/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryColumn, Column} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | @PrimaryColumn({ 6 | comment: "The ID of this user.", 7 | length: 16, 8 | type: "binary", 9 | }) 10 | id!: Uint8Array; 11 | 12 | @Column({ type: String }) 13 | name!: string; 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/438/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryColumn({ type: Number, unsigned: true }) 7 | id!: number; 8 | 9 | @Column({ type: Number, zerofill: true }) 10 | num!: number; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/4513/entity/User.ts: -------------------------------------------------------------------------------- 1 | import { Entity, PrimaryColumn, Column } from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | @PrimaryColumn({ type: String }) 6 | name!: string; 7 | 8 | @PrimaryColumn({ type: String }) 9 | email!: string; 10 | 11 | @Column({ type: Number }) 12 | age!: number; 13 | } 14 | -------------------------------------------------------------------------------- /test/github-issues/463/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | identifier!: number; 10 | 11 | @Column("simple-array") 12 | names!: string[]; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/4630/entity/User.ts: -------------------------------------------------------------------------------- 1 | import { Entity, Column, PrimaryGeneratedColumn } from "../../../../src/index.ts"; 2 | 3 | export enum Realm { 4 | Blackrock = "Blackrock", 5 | KelThuzad = "Kel'Thuzad", 6 | } 7 | 8 | @Entity() 9 | export class User { 10 | @PrimaryGeneratedColumn() 11 | id!: number; 12 | 13 | @Column({ type: "enum", enum: Realm }) 14 | realm!: Realm; 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/4697/entity/config.entity.ts: -------------------------------------------------------------------------------- 1 | import {Entity, ObjectIdColumn, /*ObjectID,*/ Column} from "../../../../src/index.ts"; 2 | 3 | /** 4 | * @deprecated use item config instead 5 | */ 6 | @Entity() 7 | export class Config { 8 | @ObjectIdColumn() 9 | _id!: any;/*ObjectID;*/ // TODO(uki00a) uncomment this when MongoDriver is implemented. 10 | 11 | @Column({ type: String }) 12 | itemId!: string; 13 | 14 | @Column({ type: "json" }) 15 | data!: any; 16 | } 17 | -------------------------------------------------------------------------------- /test/github-issues/4701/migration/1567759789051-ExampleMigration.ts: -------------------------------------------------------------------------------- 1 | import { MigrationInterface } from "../../../../src/migration/MigrationInterface.ts"; 2 | import { QueryRunner } from "../../../../src/query-runner/QueryRunner.ts"; 3 | 4 | export class ExampleMigrationOne1567759789051 implements MigrationInterface { 5 | public async up(queryRunner: QueryRunner): Promise {} 6 | public async down(queryRunner: QueryRunner): Promise {} 7 | } 8 | -------------------------------------------------------------------------------- /test/github-issues/4701/migration/1567759832591-ExampleMigrationTwo.ts: -------------------------------------------------------------------------------- 1 | import { MigrationInterface } from "../../../../src/migration/MigrationInterface.ts"; 2 | import { QueryRunner } from "../../../../src/query-runner/QueryRunner.ts"; 3 | 4 | export class ExampleMigrationOne1567759789051 implements MigrationInterface { 5 | public async up(queryRunner: QueryRunner): Promise {} 6 | public async down(queryRunner: QueryRunner): Promise {} 7 | } 8 | -------------------------------------------------------------------------------- /test/github-issues/4701/migration/1571426391120-ExampleMigrationThree.ts: -------------------------------------------------------------------------------- 1 | import { MigrationInterface } from "../../../../src/migration/MigrationInterface.ts"; 2 | import { QueryRunner } from "../../../../src/query-runner/QueryRunner.ts"; 3 | 4 | export class ExampleMigrationThree1571426391120 implements MigrationInterface { 5 | public async up(queryRunner: QueryRunner): Promise {} 6 | public async down(queryRunner: QueryRunner): Promise {} 7 | } 8 | -------------------------------------------------------------------------------- /test/github-issues/4719/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn, ObjectLiteral} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column("hstore", { hstoreType: "object" }) 10 | hstoreObj!: ObjectLiteral; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/4753/entity/User.ts: -------------------------------------------------------------------------------- 1 | import { Entity, Column, PrimaryGeneratedColumn } from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class User { 5 | @PrimaryGeneratedColumn() 6 | id!: number; 7 | 8 | @Column({ type: String }) 9 | name!: string; 10 | } 11 | -------------------------------------------------------------------------------- /test/github-issues/4782/entity/Item.ts: -------------------------------------------------------------------------------- 1 | import { CreateDateColumn } from "../../../../src/index.ts"; 2 | import { PrimaryGeneratedColumn } from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import { Entity } from "../../../../src/decorator/entity/Entity.ts"; 4 | 5 | @Entity() 6 | export class Item { 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @CreateDateColumn() 11 | date!: Date; 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/479/entity/Car.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Car { 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | name!: string; 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/4842/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | title!: string; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/485/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | 4 | @Entity() 5 | export class Post { 6 | 7 | @PrimaryGeneratedColumn("uuid") 8 | id!: string; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /test/github-issues/493/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryColumn} from "../../../../src/decorator/columns/PrimaryColumn.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryColumn({ type: String }) 9 | id!: string; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/495/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class User { 7 | 8 | @PrimaryGeneratedColumn() 9 | userId!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/5004/entity/Foo.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 3 | import {Index} from "../../../../src/decorator/Index.ts"; 4 | 5 | @Entity() 6 | export class Foo { 7 | @Column("date") 8 | @Index({ expireAfterSeconds: 0 }) 9 | expireAt!: Date; 10 | } 11 | -------------------------------------------------------------------------------- /test/github-issues/5174/entity/Role.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryColumn, OneToMany} from "../../../../src/index.ts"; 3 | import {User} from "./User.ts"; 4 | 5 | @Entity() 6 | export class Role { 7 | 8 | @PrimaryColumn({ type: String }) 9 | id!: string; 10 | 11 | @OneToMany(_ => User, user => user.role, { cascade: true }) 12 | users!: User[]; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/5174/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryColumn, ManyToOne} from "../../../../src/index.ts"; 3 | import {Role} from "./Role.ts"; 4 | 5 | @Entity() 6 | export class User { 7 | 8 | @PrimaryColumn({ type: Number }) 9 | id!: number; 10 | 11 | @ManyToOne(_ => Role, role => role.users) 12 | role!: Role; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/521/entity/Car.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Car { 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | name!: string; 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/56/entity/AccessToken.ts: -------------------------------------------------------------------------------- 1 | import {PrimaryColumn} from "../../../../src/decorator/columns/PrimaryColumn.ts"; 2 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 3 | 4 | @Entity() 5 | export class AccessToken { 6 | 7 | @PrimaryColumn({ type: String }) 8 | access_token!: string; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /test/github-issues/594/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | postId!: number; 8 | 9 | @Column({ type: Number }) 10 | modelId!: number; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/609/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {CreateDateColumn, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @CreateDateColumn({ precision: null, type: "timestamp", default: () => "CURRENT_TIMESTAMP" }) 10 | createDate!: Date; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/620/entity/Dog.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/index.ts"; 2 | import {PrimaryColumn} from "../../../../src/decorator/columns/PrimaryColumn.ts"; 3 | import {OneToMany} from "../../../../src/decorator/relations/OneToMany.ts"; 4 | import {Cat} from "./Cat.ts"; 5 | 6 | @Entity() 7 | export class Dog { 8 | 9 | @PrimaryColumn({ type: String }) 10 | DogID!: string; 11 | 12 | @OneToMany(type => Cat, cat => cat.dog) 13 | cats!: Cat[]; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/660/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class User { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/704/entity/User.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class User { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | email!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/720/entity/Message.ts: -------------------------------------------------------------------------------- 1 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 2 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 3 | 4 | @Entity() 5 | export class Message { 6 | 7 | @PrimaryGeneratedColumn("increment", { type: "bigint" }) 8 | id!: string; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /test/github-issues/762/entity/FooChildMetadata.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | 3 | export class FooChildMetadata { 4 | 5 | @Column({ nullable: true, type: Number }) 6 | something!: number; 7 | 8 | @Column({ nullable: true, type: Number }) 9 | somethingElse!: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /test/github-issues/762/entity/FooMetadata.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | import {FooChildMetadata} from "./FooChildMetadata.ts"; 3 | 4 | export class FooMetadata { 5 | 6 | @Column({ type: Number, nullable: true }) 7 | bar!: number; 8 | 9 | @Column(type => FooChildMetadata) 10 | child?: FooChildMetadata; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/github-issues/778/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn({ type: "bigint" }) 9 | id!: string; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/778/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/778/entity/Question.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 3 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 4 | 5 | @Entity() 6 | export class Question { 7 | 8 | @PrimaryGeneratedColumn({ type: "smallint" }) 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/80/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/github-issues/813/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Category { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/github-issues/922/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column("hstore", { hstoreType: "object" }) 10 | hstoreObj!: Object; 11 | 12 | @Column("hstore", { hstoreType: "string" }) 13 | hstoreStr!: string; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /test/github-issues/929/entity/TestEntity.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class TestEntity { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/other-issues/escaping-function-parameter/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/other-issues/hydrate-performance/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Column, Entity, PrimaryGeneratedColumn} from "../../../../src/index.ts"; 2 | 3 | @Entity() 4 | export class Post { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | @Column({ type: String }) 10 | title!: string; 11 | 12 | constructor(title?: string) { 13 | if (title) this.title = title; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /test/other-issues/inheritance-duplicate-columns/entity/BaseContent.ts: -------------------------------------------------------------------------------- 1 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 2 | 3 | export class BaseContent { 4 | 5 | @PrimaryGeneratedColumn() 6 | id!: number; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /test/other-issues/inheritance-duplicate-columns/entity/BasePost.ts: -------------------------------------------------------------------------------- 1 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 2 | import {BaseContent} from "./BaseContent.ts"; 3 | 4 | export class BasePost extends BaseContent { 5 | 6 | @PrimaryGeneratedColumn() 7 | id!: number; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/other-issues/join-empty-relations/entity/Author.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Author { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/other-issues/limit-with-order-by/entity/Category.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Category { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | name!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/other-issues/mssql-add-column-with-default-value/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | @PrimaryGeneratedColumn() 8 | id!: number; 9 | 10 | @Column({ type: String }) 11 | title!: string; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/other-issues/nested-child-entities/entity/BilliardsTournament.ts: -------------------------------------------------------------------------------- 1 | import {ChildEntity} from "../../../../src/index.ts"; 2 | 3 | import {Tournament} from "./Tournament.ts"; 4 | 5 | @ChildEntity() // Causes Error of duplicated column in generated sql 6 | export class BilliardsTournament extends Tournament { 7 | constructor(billiardsTournament?: {name: string}) { 8 | super(billiardsTournament); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/other-issues/nested-child-entities/entity/SquadBilliardsTournament.ts: -------------------------------------------------------------------------------- 1 | import {ChildEntity} from "../../../../src/index.ts"; 2 | 3 | import {BilliardsTournament} from "./BilliardsTournament.ts"; 4 | 5 | @ChildEntity() 6 | export class SquadBilliardsTournament extends BilliardsTournament { 7 | constructor(squadBilliardsTournament?: {name: string}) { 8 | super(squadBilliardsTournament); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/other-issues/nested-child-entities/entity/TournamentGraph.ts: -------------------------------------------------------------------------------- 1 | import {Entity, PrimaryGeneratedColumn, OneToOne} from "../../../../src/index.ts"; 2 | 3 | import {Tournament} from "./Tournament.ts"; 4 | 5 | @Entity() 6 | export class TournamentGraph { 7 | @PrimaryGeneratedColumn() 8 | public id!: number; 9 | 10 | @OneToOne(type => Tournament, tournament => tournament.graph) 11 | public tournament!: Tournament; 12 | } 13 | -------------------------------------------------------------------------------- /test/other-issues/preventing-injection/entity/Post.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 4 | 5 | @Entity() 6 | export class Post { 7 | 8 | @PrimaryGeneratedColumn() 9 | id!: number; 10 | 11 | @Column({ type: String }) 12 | title!: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test/other-issues/take-multiple-pk/entity/Role.ts: -------------------------------------------------------------------------------- 1 | import {Column} from "../../../../src/decorator/columns/Column.ts"; 2 | import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn.ts"; 3 | import {Entity} from "../../../../src/decorator/entity/Entity.ts"; 4 | 5 | @Entity() 6 | export class Role { 7 | @PrimaryGeneratedColumn() id!: number; 8 | 9 | @Column({ type: String }) name!: string; 10 | } 11 | -------------------------------------------------------------------------------- /test/utils/test-setup.ts: -------------------------------------------------------------------------------- 1 | import "source-map-support/register"; 2 | import "reflect-metadata"; 3 | import * as chai from "chai"; 4 | 5 | chai.should(); 6 | chai.use(require("sinon-chai")); 7 | chai.use(require("chai-as-promised")); -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3.8.3", 3 | "compilerOptions": { 4 | "strict": true, 5 | "target": "esnext", 6 | "experimentalDecorators": true, 7 | "sourceMap": true 8 | }, 9 | "exclude": [ 10 | "tmp", 11 | "temp", 12 | "build", 13 | "node_modules" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /vendor/https/deno.land/std/async/deferred.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/std@0.85.0/async/deferred.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/std/encoding/utf8.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/std@0.85.0/encoding/utf8.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/std/encoding/yaml.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/std@0.85.0/encoding/yaml.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/std/fmt/colors.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/std@0.85.0/fmt/colors.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/std/fs/empty_dir.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/std@0.85.0/fs/empty_dir.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/std/fs/ensure_dir.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/std@0.85.0/fs/ensure_dir.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/std/fs/exists.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/std@0.85.0/fs/exists.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/std/fs/expand_glob.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/std@0.85.0/fs/expand_glob.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/std/hash/sha256.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/std@0.85.0/hash/sha256.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/std/node/process.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/std@0.85.0/node/process.ts"; 2 | export { default } from "https://deno.land/std@0.85.0/node/process.ts"; 3 | -------------------------------------------------------------------------------- /vendor/https/deno.land/std/path/mod.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/std@0.85.0/path/mod.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/x/dotenv/mod.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/x/dotenv@v0.5.0/mod.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/x/mysql/mod.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/x/mysql@v2.7.0/mod.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/x/postgres/mod.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/x/postgres@v0.8.0/mod.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/x/sqlite/mod.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/x/sqlite@v2.2.1/mod.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/x/yargs/deno-types.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/x/yargs@v16.2.0-deno/deno-types.ts"; 2 | -------------------------------------------------------------------------------- /vendor/https/deno.land/x/yargs/deno.ts: -------------------------------------------------------------------------------- 1 | export * from "https://deno.land/x/yargs@v16.2.0-deno/deno.ts"; 2 | export { default } from "https://deno.land/x/yargs@v16.2.0-deno/deno.ts"; 3 | --------------------------------------------------------------------------------