# 0.3.7 (opens new window) (2022-06-29)

# Bug Fixes

# Features

# Performance Improvements

# 0.3.6 (opens new window) (2022-04-12)

# Features

# 0.3.5 (opens new window) (2022-04-05)

# Bug Fixes

# 0.3.4 (opens new window) (2022-03-26)

# Bug Fixes

# Features

# 0.3.3 (opens new window) (2022-03-23)

# Bug Fixes

# Features

# 0.3.2 (opens new window) (2022-03-22)

# Bug Fixes

# Features

# Reverts

# 0.3.1 (opens new window) (2022-03-21)

# Bug Fixes

# Features

# 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 (opens new window) (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()
1
2
3
4
5
6

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
            }
        })
    }
})
1
2
3
4
5
6
7
8
9

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"
})
1
2
3
4

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

userRepository.find({
    relations: {
        photos: true
    }
})
1
2
3
4
5

And QueryBuilder:

userRepository
    .createQueryBuilder()
    .setRelationLoadStrategy("query")
1
2
3

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"
})
1
2
3

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,
    }
})
1
2
3
4
5
6
7

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,
            }
        }
    }
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  • new relations type signature in FindOptions (used in find* methods):
userRepository.find({
    relations: {
        contacts: true,
        photos: true,
    }
})
1
2
3
4
5
6

To load nested relations use a following signature:

userRepository.find({
    relations: {
        contacts: true,
        photos: {
            album: true,
        },
    }
})
1
2
3
4
5
6
7
8
  • new order type signature in FindOptions (used in find* methods):
userRepository.find({
    order: {
        id: "ASC"
    }
})
1
2
3
4
5

Now supports nested order by-s:

userRepository.find({
    order: {
        photos: {
            album: {
                name: "ASC"
            },
        },
    }
})
1
2
3
4
5
6
7
8
9
  • 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"
            }
        }
    }
})
1
2
3
4
5
6
7
8
9

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),
    }
})
1
2
3
4
5

Gives you users with more than 10 photos.

  • boolean can be applied for relations in where statement, for example:
userRepository.find({
    where: {
        photos: true
    }
})
1
2
3
4
5

# 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"))
1
2
3

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

import ormconfig from "./ormconfig.json"

const MyDataSource = new DataSource(ormconfig)
1
2
3

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()
1

This change was made to prevent user confusion. See this issue (opens new window) for details.

  • findOne(id) signature was dropped. Use following syntax instead:
const user = await userRepository.findOneBy({
    id: id // where id is your column name
})
1
2
3

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 */ }
})
1
2
3
4

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

const users = await userRepository.findBy({
    name: "Michael"
})
1
2
3

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])
})
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
    }
})
1
2
3
4
5

After:

userRepository.find({
    where: {
        photo: IsNull()
    }
})
1
2
3
4
5

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")
})
1
2
3

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

userRepository.find({
    membership: Equal(new MembershipKind("premium"))
})
1
2
3

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
1
2

Now:

@PrimaryColumn()
userId: number

@ManyToOne(() => User)
user: User
1
2
3
4
5

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
1
2
3
4
5
6
7
8

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

# 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"]
})
1
2
3

New way of loading entity relations:

userRepository.find({
    select: {
        id: true,
        firstName: true,
        lastName: true,
    }
})
1
2
3
4
5
6
7

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"]
})
1
2
3

New way of loading entity relations:

userRepository.find({
    relations: {
        contacts: true,
        photos: {
            album: true
        }
    }
})
1
2
3
4
5
6
7
8

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()
1
2
  • 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
1
2
  • 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)
// ...
1
2
3
4
5
  • 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,
}
1
2
3
4
5
6
7
8
9
  • 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 (opens new window) (2022-03-04)

# Bug Fixes

# Features

# 0.2.44 (opens new window) (2022-02-23)

# Bug Fixes

# Features

# 0.2.43 (opens new window) (2022-02-17)

# Bug Fixes

# Features

# Reverts

# 0.2.42 (opens new window) (2022-02-16)

# Bug Fixes

# Features

# Reverts

# BREAKING CHANGES

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

# 0.2.41 (opens new window) (2021-11-18)

# Bug Fixes

# Features

# 0.2.40 (opens new window) (2021-11-11)

# Bug Fixes

# Features

# Reverts

# 0.2.39 (opens new window) (2021-11-09)

# Bug Fixes

# Features

# Reverts

# 0.2.38 (opens new window) (2021-10-02)

# Bug Fixes

# Features

# 0.2.37 (opens new window) (2021-08-13)

# Bug Fixes

# Features

# 0.2.36 (opens new window) (2021-07-31)

# Bug Fixes

# Features

# 0.2.35 (opens new window) (2021-07-28)

# Bug Fixes

# Features

# 0.2.34 (opens new window) (2021-06-03)

# Bug Fixes

# 0.2.33 (opens new window) (2021-06-01)

# Bug Fixes

# Features

# 0.2.32 (opens new window) (2021-03-30)

# Bug Fixes

# Features

# 0.2.31 (opens new window) (2021-02-08)

# Bug Fixes

# Features

# BREAKING CHANGES

  • passing ColumnOptions to @PrimaryColumn does not function anymore. One must use PrimaryColumnOptions instead.
  • minor breaking change on "conflict*" options - column names used are now automatically escaped.

# 0.2.30 (opens new window) (2021-01-12)

# Bug Fixes

# Features

# 0.2.29 (opens new window) (2020-11-02)

# Bug Fixes

# Features

# Performance Improvements

# 0.2.28 (opens new window) (2020-09-30)

# Bug Fixes

# 0.2.27 (opens new window) (2020-09-29)

# Bug Fixes

# Features

# Reverts

# 0.2.26 (opens new window) (2020-09-10)

# Bug Fixes

# Features

# 0.2.25 (opens new window) (2020-05-19)

# Bug Fixes

# Features

# Performance Improvements

# 0.2.23 (opens new window), 0.2.24 (opens new window) (2020-02-28)

# Bug Fixes

# Features

# 0.2.22 (opens new window) (2019-12-23)

# Bug Fixes

# Features

# BREAKING CHANGES

  • aliases for very long relation names may be replaced with hashed strings. Fix: avoid collisions by using longest possible hash. Retain more entropy by not using only 8 characters of hashed aliases.

# 0.2.21 (opens new window) (2019-12-05)

# Bug Fixes

# Features

# 0.2.20 (opens new window) (2019-10-18)

# Bug Fixes

# Features

# 0.2.19 (opens new window) (2019-09-13)

# Bug Fixes

# Features

# 0.2.18

# Bug fixes

# Features

# 0.2.17 (2019-05-01)

# Bug fixes

# Features

# 0.2.16 (2019-03-26)

# Bug fixes

# Features

  • added lock option in FindOptions

# 0.2.15 (2019-03-14)

# Bug fixes

# Features

  • added uuidExtension option to Postgres connection options, which allows TypeORM to use the newer pgcrypto extension to generate UUIDs

# 0.2.14 (2019-02-25)

# Bug fixes

  • fixed migration issue with postgres numeric enum type - change queries are not generated if enum is not modified (#3587 (opens new window))
  • fixed mongodb entity listeners in optional embeddeds (#3450 (opens new window))
  • fixes returning invalid delete result
  • reverted lazy loading properties not enumerable feature to fix related bugs

# Features

  • added CockroachDB support
  • added browser entry point to package.json (3583 (opens new window))
  • replaced backend-only drivers by dummy driver in browser builds
  • added useLocalForage option to Sql.js connection options, which enables asynchronous load and save operations of the datatbase from the indexedDB (#3554 (opens new window))
  • added simple-enum column type (#1414 (opens new window))

# 0.2.13 (2019-02-10)

# Bug Fixes

# Features

# 0.2.12 (2019-01-20)

# Bug Fixes

# Features

@Column({
    type: "enum",
    enum: StringEnum,
    array: true,
    default: [StringEnum.ADMIN]
})
stringEnums: StringEnum[];
1
2
3
4
5
6
7

# Breaking changes

# 0.2.11

  • hot fix for mysql schema sync bug

# 0.2.10

  • allowed caching options from environment variable (#3321)
  • more accurate type for postgres ssl parameters
  • added support for ON UPDATE CASCADE relations for mysql
  • repository.save returns union type
  • added reuse of lazy relationships
  • added ability to disable prefixes for embedded columns
  • migrations can be tested
  • migration run returns array of successful migrations
  • added debug ENV option
  • added support for postgres exclusion constraints
  • bug fixes
  • documentation updates
  • fixed issue with mysql primary generated uuid ER_TOO_LONG_KEY (#1139)

# 0.2.9

  • UpdateEvent now returns with contains updatedColumns and updatedRelations

# 0.2.8

  • added support for specifying isolation levels in transactions
  • added SQLCipher connection option for sqlite
  • added driver to support Expo platform for sqlite
  • added support for nativescript
  • bug fixes
  • documentation updates

# 0.2.7

  • added support for rowversion type for mssql (#2198)

# 0.2.6

  • fixed wrong aggregate and count methods signature in mongodb

# 0.2.5

  • added support for enum arrays in postgres
  • fixed issue with lazy relations (#1953)
  • fixed issue with migration file generator using a wrong class name (#2070)
  • fixed issue with unhandled promise rejection warning on postgres connection (#2067)

# 0.2.4

  • fixed bug with relation id loader queries not working with self-referencing relations
  • fixed issues with zerofill and unsigned options not available in column options (#2049)
  • fixed issue with lazy relation loader (#2029)
  • fixed issue with closure table not properly escaped when using custom schema (#2043)
  • fixed issue #2053

# 0.2.3

  • fixed bug with selecting default values after persistence when initialized properties defined
  • fixed bug with find operators used on relational columns (#2031)
  • fixed bug with DEFAULT as functions in mssql (#1991)

# 0.2.2

  • fixing bugs with STI
  • fixed bug in mysql schema synchronization

# 0.2.1

  • fixed bug with STI
  • fixed bug with lazy relations inside transactions

# 0.2.0

  • completely refactored, improved and optimized persistence process and performance.
  • removed cascade remove functionality, refactored how cascades are working.
  • removed cascadeRemove option from relation options.
  • replaced cascadeAll with cascade: true syntax from relation options.
  • replaced cascadeInsert with cascade: ["insert"] syntax from relation options.
  • replaced cascadeUpdate with cascade: ["update"] syntax from relation options.
  • now when one-to-one or many-to-one relation is loaded and its not set (set to null) ORM returns you entity with relation set to null instead of undefined property as before.
  • now relation id can be set directly to relation, e.g. Post { @ManyToOne(type => Tag) tag: Tag|number } with post.tag = 1 usage.
  • now you can disable persistence on any relation by setting @OneToMany(type => Post, post => tag, { persistence: false }). This can dramatically improve entity save performance.
  • loadAllRelationIds method of QueryBuilder now accepts list of relation paths that needs to be loaded, also disableMixedMap option is now by default set to false, but you can enable it via new method parameter options
  • now returning and output statements of InsertQueryBuilder support array of columns as argument
  • now when many-to-many and one-to-many relation set to null all items from that relation are removed, just like it would be set to empty array
  • fixed issues with relation update from one-to-one non-owner side
  • now version column is updated on the database level, not by ORM anymore
  • now created date and update date columns is set on the database level, not by ORM anymore (e.g. using CURRENT_TIMESTAMP as a default value)
  • now InsertQueryBuilder, UpdateQueryBuilder and DeleteQueryBuilder automatically update entities after execution. This only happens if real entity objects are passed. Some databases (like mysql and sqlite) requires a separate query to perform this operation. If you want to disable this behavior use queryBuilder.updateEntity(false) method. This feature is convenient for users who have uuid, create/update date, version columns or columns with DEFAULT value set.
  • now InsertQueryBuilder, UpdateQueryBuilder and DeleteQueryBuilder call subscribers and listeners. You can disable this behavior by setting queryBuilder.callListeners(false) method.
  • Repository and EntityManager method .findOneById is deprecated and will be removed in next 0.3.0 version. Use findOne(id) method instead now.
  • InsertQueryBuilder now returns InsertResult which contains extended information and metadata about runned query
  • UpdateQueryBuilder now returns UpdateResult which contains extended information and metadata about runned query
  • DeleteQueryBuilder now returns DeleteResult which contains extended information and metadata about runned query
  • now insert / update / delete queries built with QueryBuilder can be wrapped into a transaction using useTransaction(true) method of the QueryBuilder.
  • insert, update and delete methods of QueryRunner now use InsertQueryRunner, UpdateQueryRunner and DeleteQueryRunner inside
  • removed deprecated removeById, removeByIds methods
  • removed deleteById method - use delete(id) method instead now
  • removed updateById method - use update(id) method instead now
  • changed snakeCase utility - check table names after upgrading
  • added ability to disable transaction in save and remove operations
  • added ability to disable listeners and subscribers in save and remove operations
  • added ability to save and remove objects in chunks
  • added ability to disable entity reloading after insertion and updation
  • class table inheritance functionality has been completely dropped
  • single table inheritance functionality has been fixed
  • @SingleEntityChild has been renamed to @ChildEntity
  • @DiscriminatorValue has been removed, instead parameter in @ChildEntity must be used, e.g. @ChildEntity("value")
  • @DiscriminatorColumn decorator has been removed, use @TableInheritance options instead now
  • skipSync in entity options has been renamed to synchronize. Now if it set to false schema synchronization for the entity will be disabled. By default its true.
  • now array initializations for relations are forbidden and ORM throws an error if there are entities with initialized relation arrays.
  • @ClosureEntity decorator has been removed. Instead @Entity + @Tree("closure-table") must be used
  • added support for nested set and materialized path tree hierarchy patterns
  • breaking change on how array parameters work in queries - now instead of (:param) new syntax must be used (:...param). This fixed various issues on how real arrays must work
  • changed the way how entity schemas are created (now more type-safe), now interface EntitySchema is a class
  • added @Unique decorator. Accepts custom unique constraint name and columns to be unique. Used only on as composite unique constraint, on table level. E.g. @Unique("uq_id_name", ["id", "name"])
  • added @Check decorator. Accepts custom check constraint name and expression. Used only on as composite check constraint, on table level. E.g. @Check("chk_name", "name <> 'asd'")
  • fixed Oracle issues, now it will be fully maintained as other drivers
  • implemented migrations functionality in all drivers
  • CLI commands changed from migrations:create, migrations:generate, migrations:revert and migrations:run to migration:create, migration:generate, migration:revert and migration:run
  • changed the way how migrations work (more info in #1315). Now migration table contains id column with auto-generated keys, you need to re-create migrations table or add new column manually.
  • entity schemas syntax was changed
  • dropped support for WebSql and SystemJS
  • @Index decorator now accepts synchronize option. This option need to avoid deleting custom indices which is not created by TypeORM
  • new flag in relation options was introduced: { persistence: false }. You can use it to prevent any extra queries for relations checks
  • added support for UNSIGNED and ZEROFILL column attributes in MySQL
  • added support for generated columns in MySQL
  • added support for ON UPDATE column option in MySQL
  • added SPATIAL and FULLTEXT index options in MySQL
  • added hstore and enum column types support in Postgres
  • added range types support in Postgres
  • TypeORM now uses { "supportBigNumbers": true, "bigNumberStrings": true } options by default for node-mysql
  • Integer data types in MySQL now accepts width option instead of length
  • junction tables now have onDelete: "CASCADE" attribute on their foreign keys
  • ancestor and descendant columns in ClosureTable marked as primary keys
  • unique index now will be created for the join columns in ManyToOne and OneToOne relations

# 0.1.19

  • fixed bug in InsertQueryBuilder

# 0.1.18

  • fixed timestamp issues

# 0.1.17

  • fixed issue with entity order by applied to update query builder

# 0.1.16

  • security and bug fixes

# 0.1.15

  • security and bug fixes

# 0.1.14

# 0.1.13

# 0.1.12

# 0.1.11

# 0.1.10

  • sqljs driver now enforces FK integrity by default (same behavior as sqlite)
  • fixed issue that broke browser support in 0.1.8 because of the debug package (#1344 (opens new window))

# 0.1.9

# 0.1.8

  • New DebugLogger (#1302 (opens new window))
  • fixed issue with primary relations being nullable by default - now they are not nullable always
  • fixed issue with multiple databases support when tables with same name are used across multiple databases

# 0.1.7

# 0.1.6

# 0.1.5

# 0.1.4

# 0.1.3

# 0.1.2

# 0.1.1

  • added support for pg-native for postgres (#975). To use it you just need to install npm i pg-native and it will be picked up automatically.
  • now Find Options support -1 and 1 for DESC and ASC values. This is better user experience for MongoDB users.
  • now inheritances in embeddeds are supported (#966).
  • isArray: boolean in ColumnOptions is deprecated. Use array: boolean instead.
  • deprecated removeById method, now use deleteById method instead.
  • added insert and delete methods into repository and entity manager.
  • fixed multiple issues with update, updateById and removeById methods in repository and entity manager. Now they do not use save and remove methods anymore - instead they are using QueryBuilder to build and execute their queries.
  • now save method can accept partial entities.
  • removed opencollective dependency.
  • fixed issues with bulk entity insertions.
  • find* methods now can find by embed conditions.
  • fixed issues with multiple schema support, added option to @JoinTable to support schema and database.
  • multiple small bugfixes.

# 0.1.0

# BREAKING CHANGES

  • Table, AbstractTable, ClassTableChild, ClosureTable, EmbeddableTable, SingleTableChild deprecated decorators were removed. Use Entity, ClassEntityChild, ClosureEntity, SingleEntityChild decorators instead.
  • EntityManager#create, Repository#create, EntityManager#preload, Repository#preload, EntityManager#merge, Repository#merge methods now accept DeepPartial<Entity> instead of Object.
  • EntityManager#merge, Repository#merge methods first argument is now an entity where to need to merge all given entity-like objects.
  • changed find* repository methods. Now conditions are Partial<Entity> type.
  • removed FindOptions interface and introduced two new interfaces: FindOneOptions and FindManyOptions - each for its own findOne* or find* methods.
  • dropped out some of options of FindOptions. Use QueryBuilder instead. However, added few new options as well.
  • deprecated method addParameters has been removed from QueryBuilder. Use setParameters instead.
  • removed setMaxResults, setFirstResult methods in QueryBuilder. Use take and skip methods instead.
  • renamed entityManager to manager in Connection, AbstractRepository and event objects. entityManager property was removed.
  • renamed persist to save in EntityManager and Repository objects. persist method was removed.
  • SpecificRepository is removed. Use relational query builder functionality instead.
  • transaction method has been removed from Repository. Use EntityManager#transaction method instead.
  • custom repositories do not support container anymore.
  • controller / subscriber / migrations from options tsconfig now appended with a project root directory
  • removed naming strategy decorator, naming strategy by name functionality. Now naming strategy should be registered by passing naming strategy instance directly.
  • driver section in connection options now deprecated. All settings should go directly to connection options root.
  • removed fromTable from the QueryBuilder. Now use regular from to select from tables.
  • removed usePool option from the connection options. Pooling now is always enabled.
  • connection options interface has changed and now each platform has its own set of connection options.
  • storage in sqlite options has been renamed to database.
  • env variable names for connection were changed (TYPEORM_DRIVER_TYPE has been renamed to TYPEORM_CONNECTION, some other renaming). More env variable names you can find in ConnectionOptionsEnvReader class.
  • some api changes in ConnectionManager and createConnection / createConnections methods of typeorm main entrypoint.
  • simple_array column type now is called simple-array
  • some column types were removed. Now orm uses column types of underlying database.
  • now number type in column definitions (like @Column() likes: number) maps to integer instead of double. This is more programmatic design. If you need to store float-pointing values - define a type explicitly.
  • fixedLength in column options has been removed. Now actual column types can be used, e.g. @Column("char") or @Column("varchar").
  • timezone option has been removed from column options. Now corresponding database types can be used instead.
  • localTimezone has been removed from the column options.
  • skipSchemaSync in entity options has been renamed to skipSync.
  • setLimit and setOffset in QueryBuilder were renamed into limit and offset.
  • nativeInterface has been removed from a driver interface and implementations.
  • now typeorm works with the latest version of mssql (version 4).
  • fixed how orm creates default values for SqlServer - now it creates constraints for it as well.
  • migrations interface has changed - now up and down accept only QueryRunner. To use Connection and EntityManager use properties of QueryRunner, e.g. queryRunner.connection and queryRunner.manager.
  • now update method in QueryBuilder accepts Partial<Entity> and property names used in update map are column property names and they are automatically mapped to column names.
  • SpecificRepository has been removed. Instead new RelationQueryBuilder was introduced.
  • getEntitiesAndRawResults of QueryBuilder has been renamed to getRawAndEntities.
  • in mssql all constraints are now generated using table name in their names - this is fixes issues with duplicate constraint names.
  • now when object is loaded from the database all its columns with null values will be set into entity properties as null. Also after saving entity with unset properties that will be stored as nulls - their (properties) values will be set to null.
  • create and update dates in entities now use date with fractional seconds.
  • @PrimaryGeneratedColumn decorator now accept generation strategy as first argument (default is increment), instead of column type. Column type must be passed in options object, e.g. @PrimaryGeneratedColumn({ type: "bigint"}).
  • @PrimaryColumn now does not accept generated parameter in options. Use @Generated or @PrimaryGeneratedColumn decorators instead.
  • Logger interface has changed. Custom logger supply mechanism has changed.
  • Now logging options in connection options is simple "true", or "all", or list of logging modes can be supplied.
  • removed driver section in connection options. Define options right in the connection options section.
  • Embedded decorator is deprecated now. use @Column(type => SomeEmbedded) instead.
  • schemaName in connection options is removed. Use schema instead.
  • TYPEORM_AUTO_SCHEMA_SYNC env variable is now called TYPEORM_SYNCHRONIZE.
  • schemaSync method in Connection has been renamed to synchronize.
  • getEntityManager has been deprecated. Use getManager instead.
  • @TransactionEntityManager is now called @TransactionManager now.
  • EmbeddableEntity, Embedded, AbstractEntity decorators has been removed. There is no need to use EmbeddableEntity and AbstractEntity decorators at all - entity will work as expected without them. Instead of @Embedded(type => X) decorator now @Column(type => X) must be used instead.
  • tablesPrefix, autoSchemaSync, autoMigrationsRun, dropSchemaOnConnection options were removed. Use entityPrefix, synchronize, migrationsRun, dropSchema options instead.
  • removed persist method from the Repository and EntityManager. Use save method instead.
  • removed getEntityManager from typeorm namespace. Use getManager method instead.
  • refactored how query runner works, removed query runner provider
  • renamed TableSchema into Table
  • renamed ColumnSchema into TableColumn
  • renamed ForeignKeySchema into TableForeignKey
  • renamed IndexSchema into TableIndex
  • renamed PrimaryKeySchema into TablePrimaryKey

# NEW FEATURES

  • added mongodb support.
  • entity now can be saved partially within update method.
  • added prefix support to embeddeds.
  • now embeddeds inside other embeddeds are supported.
  • now relations are supported inside embeds.
  • now relations for multiple primary keys are generated properly.
  • now ormconfig is read from .env, .js, .json, .yml, .xml formats.
  • all database-specific types are supported now.
  • now migrations generation in mysql is supported. Use typeorm migrations:generate command.
  • getGeneratedQuery was renamed to getQuery in QueryBuilder.
  • getSqlWithParameters was renamed to getSqlAndParameters in QueryBuilder.
  • sql queries are highlighted in console.
  • added @Generated decorator. It can accept strategy option with values increment and uuid. Default is increment. It always generates value for column, except when column defined as nullable and user sets null value in to column.
  • added logging of log-running requests.
  • added replication support.
  • added custom table schema and database support in Postgres, Mysql and Sql Server drivers.
  • multiple bug fixes.
  • added ActiveRecord support (by extending BaseEntity) class
  • Connection how has createQueryRunner that can be used to control database connection and its transaction state
  • QueryBuilder is abstract now and all different kinds of query builders were created for different query types - SelectQueryBuilder, UpdateQueryBuilder, InsertQueryBuilder and DeleteQueryBuilder with individual method available.

# 0.0.11

  • fixes #341 (opens new window) - issue when trying to create a OneToOne relation with referencedColumnName where the relation is not between primary keys

# 0.0.10

  • added ObjectLiteral and ObjectType into main exports
  • fixed issue fixes #345 (opens new window).
  • fixed issue with migration not saving into the database correctly. Note its a breaking change if you have run migrations before and have records in the database table, make sure to apply corresponding changes. More info in #360 (opens new window) issue.

# 0.0.9

# 0.0.8

# 0.0.7

# 0.0.6

# 0.0.5

  • changed getScalarMany to getRawMany in QueryBuilder
  • changed getScalarOne to getRawOne in QueryBuilder
  • added migrations support

# 0.0.4

  • fixed problem when order by is used with limit
  • fixed problem when decorators-shim.d.ts exist and does not allow to import decorators (treats like they exist in global)
  • fixed Sql Server driver bugs

# 0.0.3

  • completely refactored persistence mechanism:
    • added experimental support of { nullable: true } in relations
    • cascade operations should work better now
    • optimized all queries
    • entities with recursive entities should be persisted correctly now
  • now undefined properties are skipped in the persistence operation, as well as undefined relations.
  • added platforms abstractions to allow typeorm to work on multiple platforms
  • added experimental support of typeorm in the browser
  • breaking changes in QueryBuilder:
    • getSingleResult() renamed to getOne()
    • getResults() renamed to getMany()
    • getResultsAndCount() renamed to getManyAndCount()
    • in the innerJoin*/leftJoin* methods now no need to specify ON
    • in the innerJoin*/leftJoin* methods no longer supports parameters, use addParameters or setParameter instead.
    • setParameters is now works just like addParameters (because previous behaviour confused users), addParameters now is deprecated
    • getOne returns Promise<Entity|undefined>
  • breaking changes in Repository and EntityManager:
    • findOne and .findOneByIdnow returnPromise<Entity|undefined>instead ofPromise`
  • now typeorm is compiled into ES5 instead of ES6 - this allows to run it on older versions of node.js
  • fixed multiple issues with dates and utc-related stuff
  • multiple bugfixes

# 0.0.2

  • lot of API refactorings
  • complete support TypeScript 2
  • optimized schema creation
  • command line tools
  • multiple drivers support
  • multiple bugfixes

# 0.0.1

  • first stable version, works with TypeScript 1.x