CHANGELOG

0.3.20 (2024-01-26)

Bug Fixes

Features

Reverts

  • Revert "fix: prevent using absolute table path in migrations unless required (#10123)" (#10624) (8f371f2), closes #10123 #10624

  • revert "feat: nullable embedded entities (#10289)" (#10614) (15de46f), closes #10289 #10614

0.3.19 (2024-01-03)

Bug Fixes

  • fixed Cannot read properties of undefined (reading 'sync') caused after glob package upgrade

0.3.18 (2024-01-03)

Bug Fixes

Features

Performance Improvements

BREAKING CHANGES

  • With node-oracledb the thin client is used as default. Added a option to use the thick client. Also added the option to specify the instant client lib

  • MongoDB: from the previous behavior of returning a result with metadata describing when a document is not found. See: https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/CHANGES_6.0.0.md

  • new nullable embeds feature introduced a breaking change which might enforce you to update types on your entities to | null, if all columns in your embed entity are nullable. Since database queries now return embedded property as null if all its column values are null.

0.3.17 (2023-06-20)

Bug Fixes

0.3.16 (2023-05-09)

Bug Fixes

Features

  • mariadb uuid inet4 inet6 column data type support (#9845) (d8a2e37)

Reverts

0.3.15 (2023-04-15)

Bug Fixes

  • make cache optional fields optional (#9942) (159c60a)

  • prevent unique index identical to primary key (all sql dialects) (#9940) (51eecc2)

  • SelectQueryBuilder builds incorrectly escaped alias in Oracle when used on entity with composite key (#9668) (83c6c0e)

Features

0.3.14 (2023-04-09)

Bug Fixes

  • drop xml & yml connection option support. Addresses security issues in underlying dependency (#9930) (7dac12c)

Features

0.3.13 (2023-04-06)

Bug Fixes

  • firstCapital=true not working in camelCase() function (f1330ad)

  • handles "query" relation loading strategy for TreeRepositories (#9680) (a11809e), closes #9673

  • improve EntityNotFound error message in QueryBuilder.findOneOrFail (#9872) (f7f6817)

  • loading tables with fk in sqlite query runner (#9875) (4997da0), closes #9266

  • prevent foreign key support during migration batch under sqlite (#9775) (197cc05), closes #9770

  • proper default value on generating migration when default value is a function calling [Postgres] (#9830) (bebba05)

  • react-native doesn't properly work in ESM projects because of circular dependency (#9765) (099fcd9)

  • resolve issues for mssql migration when simple-enum was changed (cb154d4), closes #7785 #9457 #7785 #9457

  • resolves issue with mssql column recreation (#9773) (07221a3), closes #9399

  • transform values for FindOperators #9381 (#9777) (de1228d), closes #9816

  • use forward slashes when normalizing path (#9768) (58fc088), closes #9766

  • use object create if entity skip constructor is set (#9831) (a868979)

Features

  • add support for json datatype for sqlite (#9744) (4ac8c00)

  • add support for STI on EntitySchema (#9834) (bc306fb), closes #9833

  • allow type FindOptionsOrderValue for order by object property (#9895) (#9896) (0814970)

  • Broadcast identifier for removed related entities (#9913) (f530811)

  • leftJoinAndMapOne and innerJoinAndMapOne map result to entity (#9354) (947ffc3)

0.3.12 (2023-02-07)

Bug Fixes

  • allow to pass ObjectLiteral in mongo find where condition (#9632) (4eda5df), closes #9518

  • DataSource.setOptions doesn't properly update the database in the drivers (#9635) (a95bed7)

  • Fix grammar error in no migrations found log (#9754) (6fb2121)

  • improved FindOptionsWhere behavior with union types (#9607) (7726f5a)

  • Incorrect enum default value when table name contains dash character (#9685) (b3b0c11)

  • incorrect sorting of entities with multi-inheritances (#9406) (54ca9dd)

  • make sure "require" is defined in the environment (1a9b9fb)

  • materialized hints support for cte (#9605) (67973b4)

  • multiple select queries during db sync in sqlite (#9639) (6c928a4)

  • overriding caching settings when alwaysEnabled is true (#9731) (4df969e)

  • redundant Unique constraint on primary join column in Postgres (#9677) (b8704f8)

  • remove unnecessary .js extension in imports (#9713) (6b37e38)

  • resolve issue with "simple-enum" synchronization in SQLite (#9716) (c77c43e), closes #9715

  • sql expression when where parameter is empty array (#9691) (7df2ccf), closes #9690

  • synchronizing View with schema broken for oracle (#9602) (18b659d)

Features

0.3.11 (2022-12-03)

Fixes

  • boolean parameter escape in SQLiteDriver (#9400) (4a36d0e), closes #1981

  • cacheId not used when loading relations with take (#9469) (93e6b3d)

  • correctly return insertId for react-native (#9554) (97fae63)

  • disable transactionSupport option for CordovaDriver (#9391) (53fad8f)

  • explicitly define property for entity relation as enumerable (#9437) (85fa9c6), closes #6631

  • fix ormUtils prototype check crashing on null prototype (#9517) (19536ed)

  • fixed outdated init command (#9422) (0984307)

  • left instead of inner join for where or + optional relations (#9516) (d490793)

  • Mark array arguments to find operators as read-only (#9474) (6eb674b)

  • pass fake flag to undoLastMigration (#9562) (2458ac7), closes #9561

  • resolve issue with migrations and unsigned int columns in aurora-data-api (#9478) (38e0eff), closes #9477

  • resolve nameless TableForeign on drop foreign key (#9460) (efb4168), closes #9432

  • synchronize with typeorm_metadata table only if needed (#9175) (cdabaa3), closes #9173 #9173 #9173

  • the mpath is incorrect when the parent of the tree entity is null (#9535) (658604d)

  • typings for Repository.extend function (#9396) (f07fb2c)

Features

0.3.10 (2022-09-19)

Bug Fixes

  • "Cannot commit, no transaction is active" error in sql.js (#9234) (749809a), closes #9100

  • add missing support for primaryKeyConstraintName property in EntitySchema (cc63961)

  • malformed query when selecting deeply nested embedded entities (#9273) (83f7b88)

  • prototype pollution issue (e3aac27)

  • typescript 4.8 type issues #9331 (#9357) (a1960e1)

  • Update RelationIdLoader to use DriverUtils.getAlias (#9380) (a917d65), closes #9379

Features

0.3.9 (2022-08-28)

  • fixed regression introduced in 0.3.8 - broken CLI because of #8917 (#9332), closes #9330

0.3.8 (2022-08-26)

Bug Fixes

Features

0.3.7 (2022-06-29)

Bug Fixes

Features

  • add for_key_share ("FOR KEY SHARE") lock mode for postgres driver (#8879) (4687be8), closes #8878

  • add nativeBinding option to better-sqlite3 driver (#9157) (bcdddc3)

  • add spanner as a db option for the init command (#9121) (e61cade)

  • allow explicitly named primary keys, foreign keys, and indices (#8900) (78df84c), closes #1355

  • Cloud Spanner support (#8730) (62518ae)

  • fix issues with generated columns and add support in other drivers (#8806) (0418ebc), closes #8761

  • implement support for relationids in entity schemas (#9129) (e24cced)

  • support TS 4.7+ node16/nodenext module mode (#9043) (862a402)

  • upgrade ioredis to v5 (#8997) (723f1e5)

Performance Improvements

0.3.6 (2022-04-12)

Features

0.3.5 (2022-04-05)

Bug Fixes

  • .save repository method not returning generated uuids for aurora-postgres (#8825) (ed06f4c)

  • allow hstore type to use transformers in driver postgres (#8823) (b1a0107)

  • broken shebang parameters of cli-ts-node-commonjs and cli-ts-node-esm on some linux distros (#8821) (c5dfc11), closes #8818

  • find select object api should support false values #8796 (#8807) (9ac8e9e)

  • resolve missing ConnectionOptions export in index.ts (#8850) (1693a17), closes #8837

  • save correct discriminator with STI (#8819) (9d1e246), closes #2927

  • Update DeepPartial for usage of generics with Repository class (#8817) (8ba742e)

  • fixed issue with typeorm init command (#8820)

0.3.4 (2022-03-26)

Bug Fixes

  • BaseEntity.reload method regression and made findOne to throw error on missing conditions in runtime (#8801) (ee8c1ec)

  • improve DeepPartial recursion (#8732) (0494008), closes #8681

  • missing timestamp in created migrations filenames (#8802) (ceee439)

  • PoolConnection leaked by MysqlDriver (#8803) (d2cfd22)

  • remove console.log calls from SelectQueryBuilder (#8795) (54c7db4), closes #8792

  • stop crashing when redis is offline and ignoreErrors on cache options is set (#8725) (edc39d1)

Features

0.3.3 (2022-03-23)

Bug Fixes

  • improve initialization of custom repository (#8782) (52a641c)

  • resolve entities correctly in datasource when globs are specified (#8778) (a641c5d)

Features

0.3.2 (2022-03-22)

Bug Fixes

  • broken CLI in ESM projects since version 0.3.0 (#8773) (97699e8)

Features

  • add typeorm CLI variations that include ts-node (#8776) (05fc744)

  • allows user to specify which mysql package should be used (#8771) (35106df)

Reverts

0.3.1 (2022-03-21)

Bug Fixes

Features

  • new array find operators (ArrayContains, ArrayContainedBy, ArrayOverlap) (#8766) (9f1b8e3):

BREAKING CHANGES

  • we do not call JSON.stringify() to json/jsonb column types in Postgres. Instead, we delegate value directly to underlying pg driver. This is a correct way of handling jsons.

  • array: true must be explicitly defined for array json/jsonb values

  • strings being JSON-stringified must be manually escaped

0.3.0 (2022-03-17)

Changes in the version includes changes from the next branch and typeorm@next version. They were pending their migration from 2018. Finally, they are in the master branch and master version.

Features

  • compilation target now is es2020. This requires Node.JS version 14+

  • TypeORM now properly works when installed within different node_modules contexts (often happen if TypeORM is a dependency of another library or TypeORM is heavily used in monorepo projects)

  • Connection was renamed to DataSource. Old Connection is still there, but now it's deprecated. It will be completely removed in next version. New API:

export const dataSource = new DataSource({
    // ... options ...
})

// load entities, establish db connection, sync schema, etc.
await dataSource.connect()

Previously, you could use new Connection(), createConnection(), getConnectionManager().create(), etc. They all deprecated in favour of new syntax you can see above.

New way gives you more flexibility and simplicity in usage.

  • new custom repositories syntax:

export const UserRepository = myDataSource.getRepository(UserEntity).extend({
    findUsersWithPhotos() {
        return this.find({
            relations: {
                photos: true,
            },
        })
    },
})

Old ways of custom repository creation were dropped.

  • added new option on relation load strategy called relationLoadStrategy. Relation load strategy is used on entity load and determines how relations must be loaded when you query entities and their relations from the database. Used on find* methods and QueryBuilder. Value can be set to join or query.

    • join - loads relations using SQL JOIN expression

    • query - executes separate SQL queries for each relation

Default is join, but default can be set in ConnectionOptions:

createConnection({
    /* ... */
    relationLoadStrategy: "query",
})

Also, it can be set per-query in find* methods:

userRepository.find({
    relations: {
        photos: true,
    },
})

And QueryBuilder:

userRepository.createQueryBuilder().setRelationLoadStrategy("query")

For queries returning big amount of data, we recommend to use query strategy, because it can be a more performant approach to query relations.

  • added new findOneBy, findOneByOrFail, findBy, countBy, findAndCountBy methods to BaseEntity, EntityManager and Repository:

const users = await userRepository.findBy({
    name: "Michael",
})

Overall find* and count* method signatures where changed, read the "breaking changes" section for more info.

  • new select type signature in FindOptions (used in find* methods):

userRepository.find({
    select: {
        id: true,
        firstName: true,
        lastName: true,
    },
})

Also, now it's possible to specify select columns of the loaded relations:

userRepository.find({
    select: {
        id: true,
        firstName: true,
        lastName: true,
        photo: {
            id: true,
            filename: true,
            album: {
                id: true,
                name: true,
            },
        },
    },
})
  • new relations type signature in FindOptions (used in find* methods):

userRepository.find({
    relations: {
        contacts: true,
        photos: true,
    },
})

To load nested relations use a following signature:

userRepository.find({
    relations: {
        contacts: true,
        photos: {
            album: true,
        },
    },
})
  • new order type signature in FindOptions (used in find* methods):

userRepository.find({
    order: {
        id: "ASC",
    },
})

Now supports nested order by-s:

userRepository.find({
    order: {
        photos: {
            album: {
                name: "ASC",
            },
        },
    },
})
  • new where type signature in FindOptions (used in find* methods) now allows to build nested statements with conditional relations, for example:

userRepository.find({
    where: {
        photos: {
            album: {
                name: "profile",
            },
        },
    },
})

Gives you users who have photos in their "profile" album.

  • FindOperator-s can be applied for relations in where statement, for example:

userRepository.find({
    where: {
        photos: MoreThan(10),
    },
})

Gives you users with more than 10 photos.

  • boolean can be applied for relations in where statement, for example:

userRepository.find({
    where: {
        photos: true,
    },
})

BREAKING CHANGES

  • minimal Node.JS version requirement now is 14+

  • drop ormconfig support. ormconfig still works if you use deprecated methods, however we do not recommend using it anymore, because it's support will be completely dropped in 0.4.0. If you want to have your connection options defined in a separate file, you can still do it like this:

import ormconfig from "./ormconfig.json"

const MyDataSource = new DataSource(require("./ormconfig.json"))

Or even more type-safe approach with resolveJsonModule in tsconfig.json enabled:

import ormconfig from "./ormconfig.json"

const MyDataSource = new DataSource(ormconfig)

But we do not recommend use this practice, because from 0.4.0 you'll only be able to specify entities / subscribers / migrations using direct references to entity classes / schemas (see "deprecations" section).

We won't be supporting all ormconfig extensions (e.g. json, js, ts, yaml, xml, env).

  • support for previously deprecated migrations:* commands was removed. Use migration:* commands instead.

  • all commands were re-worked. Please refer to new CLI documentation.

  • cli option from BaseConnectionOptions (now BaseDataSourceOptions options) was removed (since CLI commands were re-worked).

  • now migrations are running before schema synchronization if you have both pending migrations and schema synchronization pending (it works if you have both migrationsRun and synchronize enabled in connection options).

  • aurora-data-api driver now is called aurora-mysql

  • aurora-data-api-pg driver now is called aurora-postgres

  • EntityManager.connection is now EntityManager.dataSource

  • Repository now has a constructor (breaks classes extending Repository with custom constructor)

  • @TransactionRepository, @TransactionManager, @Transaction decorators were completely removed. These decorators do the things out of the TypeORM scope.

  • Only junction table names shortened.

MOTIVATION: We must shorten only table names generated by TypeORM. It's user responsibility to name tables short if their RDBMS limit table name length since it won't make sense to have table names as random hashes. It's really better if user specify custom table name into @Entity decorator. Also, for junction table it's possible to set a custom name using @JoinTable decorator.

  • findOne() signature without parameters was dropped. If you need a single row from the db you can use a following syntax:

const [user] = await userRepository.find()

This change was made to prevent user confusion. See this issue for details.

  • findOne(id) signature was dropped. Use following syntax instead:

const user = await userRepository.findOneBy({
    id: id, // where id is your column name
})

This change was made to provide a more type-safe approach for data querying. Due to this change you might need to refactor the way you load entities using MongoDB driver.

  • findOne, findOneOrFail, find, count, findAndCount methods now only accept FindOptions as parameter, e.g.:

const users = await userRepository.find({
    where: {
        /* conditions */
    },
    relations: {
        /* relations */
    },
})

To supply where conditions directly without FindOptions new methods were added: findOneBy, findOneByOrFail, findBy, countBy, findAndCountBy. Example:

const users = await userRepository.findBy({
    name: "Michael",
})

This change was required to simply current find* and count* methods typings, improve type safety and prevent user confusion.

  • findByIds was deprecated, use findBy method instead in conjunction with In operator, for example:

userRepository.findBy({
    id: In([1, 2, 3]),
})

This change was made to provide a more type-safe approach for data querying.

  • findOne and QueryBuilder.getOne() now return null instead of undefined in the case if it didn't find anything in the database. Logically it makes more sense to return null.

  • findOne now limits returning rows to 1 at database level.

NOTE: FOR UPDATE locking does not work with findOne in Oracle since FOR UPDATE cannot be used with FETCH NEXT in a single query.

  • where in FindOptions (e.g. find({ where: { ... })) is more sensitive to input criteria now.

  • FindConditions (where in FindOptions) was renamed to FindOptionsWhere.

  • null as value in where used in find* methods is not supported anymore. Now you must explicitly use IsNull() operator.

Before:

userRepository.find({
    where: {
        photo: null,
    },
})

After:

userRepository.find({
    where: {
        photo: IsNull(),
    },
})

This change was made to make it more transparent on how to add "IS NULL" statement to final SQL, because before it bring too much confusion for ORM users.

  • if you had entity properties of a non-primitive type (except Buffer) defined as columns, then you won't be able to use it in find*'s where. Example:

Before for the @Column(/*...*/) membership: MembershipKind you could have a query like:

userRepository.find({
    membership: new MembershipKind("premium"),
})

now, you need to wrap this value into Equal operator:

userRepository.find({
    membership: Equal(new MembershipKind("premium")),
})

This change is due to type-safety improvement new where signature brings.

  • order in FindOptions (used in find* methods) doesn't support ordering by relations anymore. Define relation columns, and order by them instead.

  • where in FindOptions (used in find* methods) previously supported ObjectLiteral and string types. Now both signatures were removed. ObjectLiteral was removed because it seriously breaks the type safety, and string doesn't make sense in the context of FindOptions. Use QueryBuilder instead.

  • MongoRepository and MongoEntityManager now use new types called MongoFindManyOptions and MongoFindOneOptions for their find* methods.

  • primary relation (e.g. @ManyToOne(() => User, { primary: true }) user: User) support is removed. You still have an ability to use foreign keys as your primary keys, however now you must explicitly define a column marked as primary.

Example, before:

@ManyToOne(() => User, { primary: true })
user: User

Now:

@PrimaryColumn()
userId: number

@ManyToOne(() => User)
user: User

Primary column name must match the relation name + join column name on related entity. If related entity has multiple primary keys, and you want to point to multiple primary keys, you can define multiple primary columns the same way:

@PrimaryColumn()
userFirstName: string

@PrimaryColumn()
userLastName: string

@ManyToOne(() => User)
user: User

This change was required to simplify ORM internals and introduce new features.

  • prefix relation id columns contained in embedded entities (#7432)

  • find by Date object in sqlite driver (#7538)

  • issue with non-reliable new Date(ISOString) parsing (#7796)

DEPRECATIONS

  • all CLI commands do not support ormconfig anymore. You must specify a file with data source instance instead.

  • entities, migrations, subscribers options inside DataSourceOptions accepting string directories support is deprecated. You'll be only able to pass entity references in the future versions.

  • all container-related features (UseContainerOptions, ContainedType, ContainerInterface, defaultContainer, useContainer, getFromContainer) are deprecated.

  • EntityManager's getCustomRepository used within transactions is deprecated. Use withRepository method instead.

  • Connection.isConnected is deprecated. Use .isInitialized instead.

  • select in FindOptions (used in find* methods) used as an array of property names is deprecated. Now you should use a new object-literal notation. Example:

Deprecated way of loading entity relations:

userRepository.find({
    select: ["id", "firstName", "lastName"],
})

New way of loading entity relations:

userRepository.find({
    select: {
        id: true,
        firstName: true,
        lastName: true,
    },
})

This change is due to type-safety improvement new select signature brings.

  • relations in FindOptions (used in find* methods) used as an array of relation names is deprecated. Now you should use a new object-literal notation. Example:

Deprecated way of loading entity relations:

userRepository.find({
    relations: ["contacts", "photos", "photos.album"],
})

New way of loading entity relations:

userRepository.find({
    relations: {
        contacts: true,
        photos: {
            album: true,
        },
    },
})

This change is due to type-safety improvement new relations signature brings.

  • join in FindOptions (used in find* methods) is deprecated. Use QueryBuilder to build queries containing manual joins.

  • Connection, ConnectionOptions are deprecated, new names to use are: DataSource and DataSourceOptions. To create the same connection you had before use a new syntax: new DataSource({ /*...*/ }).

  • createConnection(), createConnections() are deprecated, since Connection is called DataSource now, to create a connection and connect to the database simply do:

const myDataSource = new DataSource({
    /*...*/
})
await myDataSource.connect()
  • getConnection() is deprecated. To have a globally accessible connection, simply export your data source and use it in places you need it:

export const myDataSource = new DataSource({
    /*...*/
})
// now you can use myDataSource anywhere in your application
  • getManager(), getMongoManager(), getSqljsManager(), getRepository(), getTreeRepository(), getMongoRepository(), createQueryBuilder() are all deprecated now. Use globally accessible data source instead:

export const myDataSource = new DataSource({
    /*...*/
})
export const Manager = myDataSource.manager
export const UserRepository = myDataSource.getRepository(UserEntity)
export const PhotoRepository = myDataSource.getRepository(PhotoEntity)
// ...
  • getConnectionManager() and ConnectionManager itself are deprecated - now Connection is called DataSource, and each data source can be defined in exported variable. If you want to have a collection of data sources, just define them in a variable, simply as:

const dataSource1 = new DataSource({
    /*...*/
})
const dataSource2 = new DataSource({
    /*...*/
})
const dataSource3 = new DataSource({
    /*...*/
})

export const MyDataSources = {
    dataSource1,
    dataSource2,
    dataSource3,
}
  • getConnectionOptions() is deprecated - in next version we are going to implement different mechanism of connection options loading

  • AbstractRepository is deprecated. Use new way of custom repositories creation.

  • Connection.name and BaseConnectionOptions.name are deprecated. Connections don't need names anymore since we are going to drop all related methods relying on this property.

  • all deprecated signatures will be removed in 0.4.0

EXPERIMENTAL FEATURES NOT PORTED FROM NEXT BRANCH

  • observers - we will consider returning them back with new API in future versions

  • alternative find operators - using $any, $in, $like and other operators in where condition.

0.2.45 (2022-03-04)

Bug Fixes

Features

0.2.44 (2022-02-23)

Bug Fixes

  • alter relation loader to use transforms when present (#8691) (2c2fb29), closes #8690

  • cannot read properties of undefined (reading 'joinEagerRelations') (136015b)

  • expo driver doesn't work properly because of new beforeMigration() afterMigration() callbacks (#8683) (5a71803)

  • ng webpack default import (#8688) (2d3374b), closes #8674

  • support imports of absolute paths of ESM files on Windows (#8669) (12cbfcd), closes #8651

Features

  • add option to upsert to skip update if the row already exists and no values would be changed (#8679) (8744395)

  • allow {delete,insert}().returning() on MariaDB (#8673) (7facbab), closes #7235 #7235

  • Implement deferrable foreign keys for SAP HANA (#6104) (1f54c70)

0.2.43 (2022-02-17)

Bug Fixes

  • support require to internal files without explicitly writing .js in the path (#8660) (96aed8a), closes #8656

Features

Reverts

  • Revert "feat: soft delete recursive cascade (#8436)" (#8654) (6b0b15b), closes #8436 #8654

0.2.42 (2022-02-16)

Bug Fixes

  • proper column comment mapping from database to metadata in aurora-data-api (baa5880)

  • add referencedSchema to PostgresQueryRunner (#8566) (c490319)

  • adding/removing @Generated() will now generate a migration to add/remove the DEFAULT value (#8274) (4208393), closes #5898

  • adds entity-schema support for createForeignKeyConstraints (#8606) (f224f24), closes #8489

  • allow special keyword as column name for simple-enum type on sqlite (#8645) (93bf96e)

  • correctly handle multiple-row insert for SAP HANA driver (#7957) (8f2ae71)

  • disable SQLite FK checks in synchronize / migrations (#7922) (f24822e)

  • find descendants of a non-existing tree parent (#8557) (cbb61eb), closes #8556

  • For MS SQL Server use lowercase "sys"."columns" reference. (#8400) (#8401) (e8a0f92)

  • improve DeepPartial type (#8187) (b93416d)

  • Lock peer dependencies versions (#8597) (600bd4e)

  • make EntityMetadataValidator comply with entitySkipConstructor, cover with test (#8445) (3d6c5da), closes #8444

  • materialized path being computed as "undefined1." (#8526) (09f54e0)

  • MongoConnectionOptions sslCA type mismatch (#8628) (02400da)

  • mongodb repository.find filters soft deleted rows (#8581) (f7c1f7d), closes #7113

  • mongodb@4 compatibility support (#8412) (531013b)

  • must invoke key pragma before any other interaction if SEE setted (#8478) (546b3ed), closes #8475

  • nested eager relations in a lazy-loaded entity are not loaded (#8564) (1cfd7b9)

  • QueryFailedError when tree entity with JoinColumn (#8443) (#8447) (a11c50d)

  • relation id and afterAll hook performance fixes (#8169) (31f0b55)

  • replaced custom uuid generator with uuid library (#8642) (8898a71)

  • single table inheritance returns the same discriminator value error for unrelated tables where their parents extend from the same entity (#8525) (6523fcc), closes #8522

  • updating with only update: false columns shouldn't trigger @UpdateDateColumn column updation (2834729), closes #8394 #8394 #8394

  • upsert should find unique index created by one-to-one relation (#8618) (c8c00ba)

Features

Reverts

  • migration:show command must exist with zero status code (Fixes #7349) (#8185) (e0adeee)

BREAKING CHANGES

  • update listeners and subscriber no longer triggered by soft-remove and recover

0.2.41 (2021-11-18)

Bug Fixes

  • add retryWrites to MongoConnectionOptions (#8354) (c895680), closes #7869

  • create typeorm_metadata table when running migrations (#4956) (b2c8168)

  • db caching won't work with replication enabled (#7694) (2d0abe7), closes #5919

  • incorrect composite UNIQUE constraints detection (#8364) (29cb891), closes #8158

  • Postgres enum generates unnecessary queries on schema sync (#8268) (98d5f39)

  • resolve issue delete column null on after update event subscriber (#8318) (8a5e671), closes #6327

Features

0.2.40 (2021-11-11)

Bug Fixes

  • BaseEntity finder methods to properly type-check lazy relations conditions (#5710) (0665ff5)

Features

  • add depth limiter optional parameter when loading nested trees using TreeRepository's findTrees() and findDescendantsTree() (#7926) (0c44629), closes #3909

  • add upsert methods for the drivers that support onUpdate (#8104) (3f98197), closes #2363

  • Postgres IDENTITY Column support (#7741) (969af95)

Reverts

0.2.39 (2021-11-09)

Bug Fixes

  • attach FOR NO KEY UPDATE lock to query if required (#8008) (9692930), closes #7717

  • cli should accept absolute paths for --config (4ad3a61)

  • create a different cacheId if present for count query in getManyAndCount (#8283) (9f14e48), closes #4277

  • defaults type cast filtering in Cockroachdb (#8144) (28c183e), closes #7110 #7110

  • do not generate migration for unchanged enum column (#8161) (#8164) (4638dea)

  • NativescriptQueryRunner's query method fails when targeting es2017 (#8182) (8615733)

  • OneToManySubjectBuilder bug with multiple primary keys (#8221) (6558295)

  • ordering by joined columns for PostgreSQL (#3736) (#8118) (1649882)

  • support DeleteResult in SQLiteDriver (#8237) (b678807)

Features

  • add typeorm command wrapper to package.json in project template (#8081) (19d4a91)

  • add dependency configuraiton for views #8240 (#8261) (2c861af)

  • add relation options to all tree queries (#8080) (e4d4636), closes #8076

  • add the ability to pass the driver into all database types (#8259) (2133ffe)

  • more informative logging in case of migration failure (#8307) (dc6f1c9)

  • support using custom index with SelectQueryBuilder in MySQL (#7755) (f79ae58)

Reverts

  • Revert "fix: STI types on children in joins (#3160)" (#8309) (0adad88), closes #3160 #8309

0.2.38 (2021-10-02)

Bug Fixes

  • prevent using absolute table path in migrations unless required (#8038) (e9366b3)

  • snakecase conversion for strings with numbers (#8111) (749511d)

  • use full path for table lookups (#8097) (22676a0)

Features

0.2.37 (2021-08-13)

Bug Fixes

  • allow periods in parameter identifiers (#8022) (4201938)

  • ConnectionManager connections property should include list of Connections (#8004) (2344db6)

  • entity value for date columns that are related (#8027) (5a3767f)

  • handle brackets when only one condition is passed (#8048) (ab39066)

  • handle enums with multiple apostrophes in MySQL (#8013) (37c40a6), closes #8011

  • include all drivers in driverfactory error message (#8061) (fbd1ef7)

  • resolve not returning soft deleted relations with withDeleted find option (#8017) (65cbcc7)

  • SAP HANA inserts used incorrect value for returning query (#8072) (36398db)

  • some drivers set the wrong database name when defined from url (#8058) (a3a3284)

  • throw error when not connected in drivers (#7995) (cd71f62)

Features

0.2.36 (2021-07-31)

Bug Fixes

  • add deprecated WhereExpression alias for WhereExpressionBuilder (#7980) (76e7ed9)

  • always generate migrations with template string literals (#7971) (e9c2af6)

  • use js rather than ts in all browser package manifests (#7982) (0d90bcd)

  • use nvarchar/ntext during transit for SQLServer queries (#7933) (62d7976)

Features

  • add postgres connection option applicationName (#7989) (d365acc)

0.2.35 (2021-07-28)

Bug Fixes

  • entity to be Partial<Entity> | undefined in UpdateEvent (#7783) (f033045)

  • actually return a working ReadStream from SQL Server query runner (#7893) (e80985f)

  • added version check before dropping materialized views to keep backward compatibility (#7716) (29f1f86)

  • allow for string id in mongo.findByIds call (#7838) (4b45ae1)

  • better support of relation-based properties in where clauses (#7805) (3221c50)

  • Buffer in primary columns causes bugs with relations (#7952) (37e08a7), closes #4060

  • capacitor does not correctly set journal mode (#7873) (5f20eb7)

  • Capacitor driver PRAGMA requests failing on Android (#7728) (9620a26)

  • condition is optional in SelectQueryBuilder joins (#7888) (2deaa0e)

  • correctly handle mongo replica set driver option (#7908) (9212df4)

  • correctly load yml in ConnectionOptionsYmlReader (#7743) (57f9254)

  • craft oracle connectString as a descriptor with SID (#7878) (b05d093)

  • delete operation in MongoDB impact all matched documents (#7811) (0fbae53), closes #7809

  • Do not add NULL/NOT NULL for stored columns (#7708) (3c33e9f), closes #7698

  • do OBJECT_ID lookup for column constraint instead of name in mssql (#7916) (fa8c1b0)

  • drop pool.autostart from mssql options because it's unused (#7877) (0d21a4d)