CHANGELOG
0.3.27 (2025-09-19)
Bug Fixes
Features
Performance Improvements
Reverts
0.3.26 (2025-08-16)
Notes:
When using MySQL, TypeORM now connects using
stringifyObjects: true, in order to avoid a potential security vulnerability in the mysql/mysql2 client libraries. You can revert to the old behavior by settingconnectionOptions.extra.stringifyObjects = false.When using SAP HANA, TypeORM now uses the built-in pool from the
@sap/hana-clientlibrary. The deprecatedhdb-poolis no longer necessary and can be removed. See https://typeorm.io/docs/drivers/sap/#data-source-options for the new pool options.
Bug Fixes
Features
Performance Improvements
0.3.25 (2025-06-19)
Bug Fixes
Features
0.3.24 (2025-05-14)
Bug Fixes
ci: resolve pkg.pr.new publish failure (2168441)
Features
Performance Improvements
improve save performance during entities update (15de733)
0.3.23 (2025-05-05)
⚠️ Note on a breaking change
This release includes a technically breaking change (from this PR) in the behaviour of the delete and update methods of the EntityManager and Repository APIs, when an empty object is supplied as the criteria:
await repository.delete({})
await repository.update({}, { foo: 'bar' })Old behaviour was to delete or update all rows in the table
New behaviour is to throw an error:
Empty criteria(s) are not allowed for the delete/update method.
Why?
This behaviour was not documented and is considered dangerous as it can allow a badly-formed object (e.g. with an undefined id) to inadvertently delete or update the whole table.
When the intention actually was to delete or update all rows, such queries can be rewritten using the QueryBuilder API:
await repository.createQueryBuilder().delete().execute()
// executes: DELETE FROM table_name
await repository.createQueryBuilder().update().set({ foo: 'bar' }).execute()
// executes: UPDATE table_name SET foo = 'bar'An alternative method for deleting all rows is to use:
await repository.clear()
// executes: TRUNCATE TABLE table_nameBug Fixes
update/delete/softDelete by criteria of condition objects (#10910)
Features
publish PR releases using pkg.pr.new (274bdf2)
Performance Improvements
0.3.22 (2025-04-03)
Bug Fixes
inverse relation metadata not cyclic (50a660a)
Features
Reverts
0.3.21 (2025-03-03)
Bug Fixes
Performance Improvements
0.3.20 (2024-01-26)
Bug Fixes
Features
Reverts
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 asnullif all its column values are null.
0.3.17 (2023-06-20)
Bug Fixes
0.3.16 (2023-05-09)
Bug Fixes
Features
Reverts
0.3.15 (2023-04-15)
Bug Fixes
Features
0.3.14 (2023-04-09)
Bug Fixes
Features
0.3.13 (2023-04-06)
Bug Fixes
firstCapital=true not working in camelCase() function (f1330ad)
Features
0.3.12 (2023-02-07)
Bug Fixes
make sure "require" is defined in the environment (1a9b9fb)
Features
0.3.11 (2022-12-03)
Fixes
Features
new virtual column decorator (#9339) (d305e5f), closes #9323 typeorm#9323 typeorm#9323 typeorm#9323 typeorm#9323
0.3.10 (2022-09-19)
Bug Fixes
add missing support for primaryKeyConstraintName property in EntitySchema (cc63961)
prototype pollution issue (e3aac27)
Features
0.3.9 (2022-08-28)
0.3.8 (2022-08-26)
Bug Fixes
Features
0.3.7 (2022-06-29)
Bug Fixes
support for TypeScript 4.8 (#9106) (d924b70), closes /github.com/microsoft/TypeScript/issues/49461#issuecomment-1154443477
Features
Performance Improvements
0.3.6 (2022-04-12)
Features
0.3.5 (2022-04-05)
Bug Fixes
fixed issue with
typeorm initcommand (#8820)
0.3.4 (2022-03-26)
Bug Fixes
Features
0.3.3 (2022-03-23)
Bug Fixes
Features
0.3.2 (2022-03-22)
Bug Fixes
Features
Reverts
0.3.1 (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 (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
targetnow ises2020. This requires Node.JS version14+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)
Connectionwas renamed toDataSource. OldConnectionis 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 onfind*methods andQueryBuilder. Value can be set tojoinorquery.join- loads relations using SQLJOINexpressionquery- 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,findAndCountBymethods toBaseEntity,EntityManagerandRepository:
const users = await userRepository.findBy({
name: "Michael",
})Overall find* and count* method signatures where changed, read the "breaking changes" section for more info.
new
selecttype signature inFindOptions(used infind*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
relationstype signature inFindOptions(used infind*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
ordertype signature inFindOptions(used infind*methods):
userRepository.find({
order: {
id: "ASC",
},
})Now supports nested order by-s:
userRepository.find({
order: {
photos: {
album: {
name: "ASC",
},
},
},
})new
wheretype signature inFindOptions(used infind*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 inwherestatement, for example:
userRepository.find({
where: {
photos: MoreThan(10),
},
})Gives you users with more than 10 photos.
booleancan be applied for relations inwherestatement, for example:
userRepository.find({
where: {
photos: true,
},
})BREAKING CHANGES
minimal Node.JS version requirement now is
14+drop
ormconfigsupport.ormconfigstill works if you use deprecated methods, however we do not recommend using it anymore, because it's support will be completely dropped in0.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. Usemigration:*commands instead.all commands were re-worked. Please refer to new CLI documentation.
clioption fromBaseConnectionOptions(nowBaseDataSourceOptionsoptions) 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
migrationsRunandsynchronizeenabled in connection options).aurora-data-apidriver now is calledaurora-mysqlaurora-data-api-pgdriver now is calledaurora-postgresEntityManager.connectionis nowEntityManager.dataSourceRepositorynow has a constructor (breaks classes extending Repository with custom constructor)@TransactionRepository,@TransactionManager,@Transactiondecorators 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,findAndCountmethods now only acceptFindOptionsas 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.
findByIdswas deprecated, usefindBymethod instead in conjunction withInoperator, for example:
userRepository.findBy({
id: In([1, 2, 3]),
})This change was made to provide a more type-safe approach for data querying.
findOneandQueryBuilder.getOne()now returnnullinstead ofundefinedin the case if it didn't find anything in the database. Logically it makes more sense to returnnull.findOnenow 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.
whereinFindOptions(e.g.find({ where: { ... })) is more sensitive to input criteria now.FindConditions(whereinFindOptions) was renamed toFindOptionsWhere.nullas value inwhereused infind*methods is not supported anymore. Now you must explicitly useIsNull()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*'swhere. 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.
orderinFindOptions(used infind*methods) doesn't support ordering by relations anymore. Define relation columns, and order by them instead.whereinFindOptions(used infind*methods) previously supportedObjectLiteralandstringtypes. Now both signatures were removed. ObjectLiteral was removed because it seriously breaks the type safety, andstringdoesn't make sense in the context ofFindOptions. UseQueryBuilderinstead.MongoRepositoryandMongoEntityManagernow use new types calledMongoFindManyOptionsandMongoFindOneOptionsfor theirfind*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: UserNow:
@PrimaryColumn()
userId: number
@ManyToOne(() => User)
user: UserPrimary 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: UserThis 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
ormconfiganymore. You must specify a file with data source instance instead.entities,migrations,subscribersoptions insideDataSourceOptionsacceptingstringdirectories 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
getCustomRepositoryused within transactions is deprecated. UsewithRepositorymethod instead.Connection.isConnectedis deprecated. Use.isInitializedinstead.selectinFindOptions(used infind*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.
relationsinFindOptions(used infind*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.
joininFindOptions(used infind*methods) is deprecated. UseQueryBuilderto build queries containing manual joins.Connection,ConnectionOptionsare deprecated, new names to use are:DataSourceandDataSourceOptions. To create the same connection you had before use a new syntax:new DataSource({ /*...*/ }).createConnection(),createConnections()are deprecated, sinceConnectionis calledDataSourcenow, 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 applicationgetManager(),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()andConnectionManageritself are deprecated - nowConnectionis calledDataSource, 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 loadingAbstractRepositoryis deprecated. Use new way of custom repositories creation.Connection.nameandBaseConnectionOptions.nameare 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 versionsalternative find operators- using$any,$in,$likeand other operators inwherecondition.
0.2.45 (2022-03-04)
Bug Fixes
Features
0.2.44 (2022-02-23)
Bug Fixes
cannot read properties of undefined (reading 'joinEagerRelations') (136015b)
Features
0.2.43 (2022-02-17)
Bug Fixes
Features
Reverts
0.2.42 (2022-02-16)
Bug Fixes
proper column comment mapping from database to metadata in aurora-data-api (baa5880)
Features
Reverts
BREAKING CHANGES
update listeners and subscriber no longer triggered by soft-remove and recover
0.2.41 (2021-11-18)
Bug Fixes
Features
0.2.40 (2021-11-11)
Bug Fixes
Features
Reverts
0.2.39 (2021-11-09)
Bug Fixes
cli should accept absolute paths for --config (4ad3a61)
Features
Reverts
0.2.38 (2021-10-02)
Bug Fixes
Features
0.2.37 (2021-08-13)
Bug Fixes
Features
0.2.36 (2021-07-31)
Bug Fixes
Features
0.2.35 (2021-07-28)
Bug Fixes
fix table loading when schemas are used (3a106a3)
make
OracleQueryRunnercreateDatabase if-not-exists not fail (f5a80ef)typo prevented us from pulling the schema correctly in some cases (c7f2db8)
use only table name in constraint naming strategy (5dc777f)
Features
add connection option
entitySkipConstructor(f43d561)add referenced database & schema to TableForeignKey (fff6b11)
consistent parsing and escaping of table names in QueryRunners (bd9e767)
implement OracleQueryRunner.hasDatabase (128b982)
publicly export
Transaction*Eventtypes (#7949) (2436a66), closes /github.com/typeorm/typeorm/blob/master/src/subscriber/EntitySubscriberInterface.ts#L12
0.2.34 (2021-06-03)
Bug Fixes
0.2.33 (2021-06-01)
Bug Fixes
@Unique constraint is not created with specified name (beea2e1)
Features
0.2.32 (2021-03-30)
Bug Fixes
Features
0.2.31 (2021-02-08)
Bug Fixes
Features
BREAKING CHANGES
passing
ColumnOptionsto@PrimaryColumndoes not function anymore. One must usePrimaryColumnOptionsinstead.minor breaking change on "conflict*" options - column names used are now automatically escaped.
0.2.30 (2021-01-12)
Bug Fixes
Features
0.2.29 (2020-11-02)
Bug Fixes
Features
Performance Improvements
0.2.28 (2020-09-30)
Bug Fixes
FindManyOptions order in parameter typing is important (51608ae)
0.2.27 (2020-09-29)
Bug Fixes
Features
Reverts
0.2.26 (2020-09-10)
Bug Fixes
unnecessary migrations for unsigned numeric types (#6632) (7ddaf23), closes #2943 /github.com/typeorm/typeorm/pull/6632#pullrequestreview-480932808
Features
0.2.25 (2020-05-19)
Bug Fixes
Features
Performance Improvements
Bug Fixes
.synchronize() drops json column on mariadb (#5391) (e3c78c1), closes typeorm/typeorm#3636
bug when default value in mssql were not updated if previous default was already set (9fc8329)
fk on update should not use attributes of on delete (2baa934)
Features
0.2.22 (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 (2019-12-05)
Bug Fixes
Features
0.2.20 (2019-10-18)
Bug Fixes
Features
0.2.19 (2019-09-13)
Bug Fixes
"database" option error in driver when use "url" option for connection (690e6f5)
Features
0.2.18
Bug fixes
fixed loadRelationCountAndMap when entities' primary keys are strings (#3946)
fixed QueryExpressionMap not cloning all values correctly (#4156)
fixed transform embeddeds with no columns but with nested embeddeds (mongodb) (#4131)
fixed the getMany() result being droped randomly bug when using the buffer as primary key. (#4220)
Features
adds
typeorm migration:showcommand (#4173)deprecate column
readonlyoption in favor ofupdateandinsertoptions (#4035)support sql.js v1.0 (#4104)
added support for
orUpdatein SQLlite (#4097)added support for
dirty_read(NOLOCK) in SQLServer (#4133)extend afterLoad() subscriber interface to take LoadEvent (issue #4185)
relation decorators (e.g.
@OneToMany) now also acceptstringinstead oftypeFunction, which prevents circular dependency issues in the frontend/browser (issue #4190)added support for metadata reflection in typeorm-class-transformer-shim.js (issue #4219)
added
sqlJsConfigto input config when initializing sql.js (issue #4559)
0.2.17 (2019-05-01)
Bug fixes
fixed transform embeddeds with boolean values (mongodb) (#3900)
fixed issue with schema inheritance in STI pattern (#3957)
fix performance issue when inserting into raw tables with QueryBuilder (#3931)
sqlite date hydration is susceptible to corruption (#3949)
fixed mongodb uniques, support 3 ways to define uniques (#3986)
fixed mongodb TTL index (#4044)
Features
added deferrable options for foreign keys (postgres) (#2191)
added View entity implementation (#1024). Read more at View entities
added multiple value transformer support (#4007)
0.2.16 (2019-03-26)
Bug fixes
removed unused parameters from
insert,update,deletemethods (#3888)fixed: migration generator produces duplicated changes (#1960)
fixed: unique constraint not created on embedded entity field (#3142)
fixed: FK columns have wrong length when PrimaryGeneratedColumn('uuid') is used (#3604)
fixed: column option unique sqlite error (#3803)
fixed: 'uuid' in PrimaryGeneratedColumn causes Many-to-Many Relationship to Fail (#3151)
fixed: sync enums on schema sync (#3694)
fixed: changes in enum type is not reflected when generating migration (in definition file) (#3244)
fixed: migration will keep create and drop indexes if index name is the same across tables (#3379)
Features
added
lockoption inFindOptions
0.2.15 (2019-03-14)
Bug fixes
fixed bug in
connection.dropDatabasemethod (#1414)fixed "deep relations" not loaded/mapped due to the built-in max length of Postgres (#3118)
updated all dependencies
fixed types issue from #3725
removed sql-function-support (
() =>syntax) in parameters to prevent security considerationsfix sync schema issue with postgres enum in case capital letters in entity name (#3536)
Features
added
uuidExtensionoption to Postgres connection options, which allows TypeORM to use the newerpgcryptoextension 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)
fixed mongodb entity listeners in optional embeddeds (#3450)
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)replaced backend-only drivers by dummy driver in browser builds
added
useLocalForageoption to Sql.js connection options, which enables asynchronous load and save operations of the datatbase from the indexedDB (#3554)added simple-enum column type (#1414)
0.2.13 (2019-02-10)
Bug Fixes
fixed undefined object id field in case property name is
_id(3517)allow to use mongodb index options in
Indexdecorator (#3592)fixed entity embeddeds indices in mongodb (#3585)
fixed json/jsonb column data types comparison (#3496)
fixed increment/decrement value of embedded entity (#3182)
fixed missing call
transformer.from()in case column is NULL (#3395)fixed signatures of
update/insertmethods, somefind*methods in repositories, entity managers, BaseEntity and QueryBuildershandle embedded documents through multiple levels in mongodb (#3551)
fixed hanging connections in
mssqldriver (#3327)
Features
Injection 2nd parameter(options) of constructor to
ioredis/clusteris now possible(#3538)
0.2.12 (2019-01-20)
Bug Fixes
fixed mongodb entity listeners and subscribers (#1527)
fixed connection options builder - paramters parsed from url are assigned on top of options (#3442)
fixed issue with logical operator precedence in
QueryBuilderwhereInIds(#2103)fixed missing
isolationLevelinConnection.transaction()method (#3363)fixed broken findOne method with custom join column name
fixed issue with uuid in mysql (#3374)
fixed missing export of
Exclusiondecoratorfixed signature of root
getRepositoryfunction to acceptEntitySchema<Entity>(#3402)fixed false undefined connection options passed into mongodb client (#3366)
fixed ER_DUP_FIELDNAME with simple find (#3350)
Features
queries are simplified in
findByIdsandwhereInIdsfor simple entities with single primary key (#3431)added
LessThanOrEqualandMoreThanOrEqualfind options (#3373)improve support of string, numeric and heterogeneous enums in postgres and mysql (#3414)
default value of enum array in postgres is now possible define as typescript array (#3414)
@Column({
type: "enum",
enum: StringEnum,
array: true,
default: [StringEnum.ADMIN]
})
stringEnums: StringEnum[];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 CASCADErelations for mysqlrepository.savereturns union typeadded 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
UpdateEventnow returns with containsupdatedColumnsandupdatedRelations
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
cascadeRemoveoption from relation options.replaced
cascadeAllwithcascade: truesyntax from relation options.replaced
cascadeInsertwithcascade: ["insert"]syntax from relation options.replaced
cascadeUpdatewithcascade: ["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
nullinstead ofundefined propertyas before.now relation id can be set directly to relation, e.g.
Post { @ManyToOne(type => Tag) tag: Tag|number }withpost.tag = 1usage.now you can disable persistence on any relation by setting
@OneToMany(type => Post, post => tag, { persistence: false }). This can dramatically improve entity save performance.loadAllRelationIdsmethod ofQueryBuildernow accepts list of relation paths that needs to be loaded, alsodisableMixedMapoption is now by default set to false, but you can enable it via new method parameteroptionsnow
returningandoutputstatements ofInsertQueryBuildersupport array of columns as argumentnow when many-to-many and one-to-many relation set to
nullall items from that relation are removed, just like it would be set to empty arrayfixed 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_TIMESTAMPas a default value)now
InsertQueryBuilder,UpdateQueryBuilderandDeleteQueryBuilderautomatically 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 usequeryBuilder.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,UpdateQueryBuilderandDeleteQueryBuildercall subscribers and listeners. You can disable this behavior by settingqueryBuilder.callListeners(false)method.RepositoryandEntityManagermethod.findOneByIdis deprecated and will be removed in next 0.3.0 version. UsefindOne(id)method instead now.InsertQueryBuildernow returnsInsertResultwhich contains extended information and metadata about runned queryUpdateQueryBuildernow returnsUpdateResultwhich contains extended information and metadata about runned queryDeleteQueryBuildernow returnsDeleteResultwhich contains extended information and metadata about runned querynow insert / update / delete queries built with QueryBuilder can be wrapped into a transaction using
useTransaction(true)method of the QueryBuilder.insert,updateanddeletemethods ofQueryRunnernow useInsertQueryRunner,UpdateQueryRunnerandDeleteQueryRunnerinsideremoved deprecated
removeById,removeByIdsmethodsremoved
deleteByIdmethod - usedelete(id)method instead nowremoved
updateByIdmethod - useupdate(id)method instead nowchanged
snakeCaseutility - check table names after upgradingadded ability to disable transaction in
saveandremoveoperationsadded ability to disable listeners and subscribers in
saveandremoveoperationsadded 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
@SingleEntityChildhas been renamed to@ChildEntity@DiscriminatorValuehas been removed, instead parameter in@ChildEntitymust be used, e.g.@ChildEntity("value")@DiscriminatorColumndecorator has been removed, use@TableInheritanceoptions instead nowskipSyncin entity options has been renamed tosynchronize. 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.
@ClosureEntitydecorator has been removed. Instead@Entity+@Tree("closure-table")must be usedadded 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
@Uniquedecorator. 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
@Checkdecorator. 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
Oracleissues, now it will be fully maintained as other driversimplemented migrations functionality in all drivers
CLI commands changed from
migrations:create,migrations:generate,migrations:revertandmigrations:runtomigration:create,migration:generate,migration:revertandmigration:runchanged the way how migrations work (more info in #1315). Now migration table contains
idcolumn 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
@Indexdecorator now acceptssynchronizeoption. This option need to avoid deleting custom indices which is not created by TypeORMnew flag in relation options was introduced:
{ persistence: false }. You can use it to prevent any extra queries for relations checksadded support for
UNSIGNEDandZEROFILLcolumn attributes in MySQLadded support for generated columns in MySQL
added support for
ON UPDATEcolumn option in MySQLadded
SPATIALandFULLTEXTindex options in MySQLadded
hstoreandenumcolumn types support in Postgresadded range types support in Postgres
TypeORM now uses
{ "supportBigNumbers": true, "bigNumberStrings": true }options by default fornode-mysqlInteger data types in MySQL now accepts
widthoption instead oflengthjunction tables now have
onDelete: "CASCADE"attribute on their foreign keysancestoranddescendantcolumns in ClosureTable marked as primary keysunique index now will be created for the join columns in
ManyToOneandOneToOnerelations
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
optimized hydration performance (#1672)
0.1.13
added simple-json column type (#1448)
fixed transform behaviour for timestamp columns (#1140)
fixed issue with multi-level relations loading (#1504)
0.1.12
EntitySubscriber now fires events on subclass entity (#1369)
fixed error with entity schema validator being async (#1448)
0.1.11
postgres extensions now gracefully handled when user does not have rights to use them (#1407)
0.1.10
sqljsdriver now enforces FK integrity by default (same behavior assqlite)fixed issue that broke browser support in 0.1.8 because of the debug package (#1344)
0.1.9
fixed bug with sqlite and mysql schema synchronization when uuid column is used (#1332)
0.1.8
New DebugLogger (#1302)
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
fixed bug with migrations execution in mssql (#1254)
added support for more complex ordering in paginated results (#1259)
MSSQL users are required to add "order by" for skip/offset operations since mssql does not support OFFSET/LIMIT statement without order by applied
fixed issue when relation query builder methods execute operations with empty arrays (#1241)
Webpack can now be used for node projects and not only for browser projects. To use TypeORM in Ionic with minimal changes checkout the ionic-example for the needed changes. To use webpack for non-Ionic browser webpack projects, the needed configuration can be found in the docs (#1280)
added support for loading sub-relations in via find options (#1270)
0.1.6
added support for indices and listeners in embeddeds
added support for
ON CONFLICTkeywordfixed bug with query builder where lazy relations are loaded multiple times when using
leftJoinAndSelect(#996)
0.1.5
fixed bug where
findByIdswould return values with an empty array (#1118)fixed bug in MigrationExecutor that didn't release created query builder (#1201)
0.1.4
fixed bug in mysql driver that generated wrong query when using skip (#1099)
added option to create query builder from repository without alias(#1084)
fixed bug that made column option "select" unusable (#1110)
fixed bug that generated mongodb projects what don't work (#1119)
0.1.3
added support for
sql.js. To use it you just need to installnpm i sql.jsand usesqljsas driver type (#894).added explicit require() statements for drivers (#1143)
fixed bug where wrong query is generated with multiple primary keys (#1146)
fixed bug for oracle driver where connect method was wrong (#1177)
0.1.2
fixed bug with replication support (#1035)
fixed bug with wrong embedded column names being generated (#969)
added support for caching in respositories (#1057)
added support for the
citextcolumn type for postgres (#1075)
0.1.1
added support for
pg-nativefor postgres (#975). To use it you just need to installnpm i pg-nativeand it will be picked up automatically.now Find Options support
-1and1forDESCandASCvalues. This is better user experience for MongoDB users.now inheritances in embeddeds are supported (#966).
isArray: booleaninColumnOptionsis deprecated. Usearray: booleaninstead.deprecated
removeByIdmethod, now usedeleteByIdmethod instead.added
insertanddeletemethods into repository and entity manager.fixed multiple issues with
update,updateByIdandremoveByIdmethods in repository and entity manager. Now they do not usesaveandremovemethods anymore - instead they are using QueryBuilder to build and execute their queries.now
savemethod 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
@JoinTableto support schema and database.multiple small bugfixes.
0.1.0
BREAKING CHANGES
Table,AbstractTable,ClassTableChild,ClosureTable,EmbeddableTable,SingleTableChilddeprecated decorators were removed. UseEntity,ClassEntityChild,ClosureEntity,SingleEntityChilddecorators instead.EntityManager#create,Repository#create,EntityManager#preload,Repository#preload,EntityManager#merge,Repository#mergemethods now acceptDeepPartial<Entity>instead ofObject.EntityManager#merge,Repository#mergemethods first argument is now an entity where to need to merge all given entity-like objects.changed
find*repository methods. Now conditions arePartial<Entity>type.removed
FindOptionsinterface and introduced two new interfaces:FindOneOptionsandFindManyOptions- each for its ownfindOne*orfind*methods.dropped out some of options of
FindOptions. UseQueryBuilderinstead. However, added few new options as well.deprecated method
addParametershas been removed fromQueryBuilder. UsesetParametersinstead.removed
setMaxResults,setFirstResultmethods inQueryBuilder. Usetakeandskipmethods instead.renamed
entityManagertomanagerinConnection,AbstractRepositoryand event objects.entityManagerproperty was removed.renamed
persisttosaveinEntityManagerandRepositoryobjects.persistmethod was removed.SpecificRepositoryis removed. Use relational query builder functionality instead.transactionmethod has been removed fromRepository. UseEntityManager#transactionmethod 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.
driversection in connection options now deprecated. All settings should go directly to connection options root.removed
fromTablefrom theQueryBuilder. Now use regularfromto select from tables.removed
usePooloption 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.
storagein sqlite options has been renamed todatabase.env variable names for connection were changed (
TYPEORM_DRIVER_TYPEhas been renamed toTYPEORM_CONNECTION, some other renaming). More env variable names you can find inConnectionOptionsEnvReaderclass.some api changes in
ConnectionManagerandcreateConnection/createConnectionsmethods of typeorm main entrypoint.simple_arraycolumn type now is calledsimple-arraysome column types were removed. Now orm uses column types of underlying database.
now
numbertype in column definitions (like@Column() likes: number) maps tointegerinstead ofdouble. This is more programmatic design. If you need to store float-pointing values - define a type explicitly.fixedLengthin column options has been removed. Now actual column types can be used, e.g.@Column("char")or@Column("varchar").timezoneoption has been removed from column options. Now corresponding database types can be used instead.localTimezonehas been removed from the column options.skipSchemaSyncin entity options has been renamed toskipSync.setLimitandsetOffsetinQueryBuilderwere renamed intolimitandoffset.nativeInterfacehas 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
upanddownaccept onlyQueryRunner. To useConnectionandEntityManageruse properties ofQueryRunner, e.g.queryRunner.connectionandqueryRunner.manager.now
updatemethod inQueryBuilderacceptsPartial<Entity>and property names used in update map are column property names and they are automatically mapped to column names.SpecificRepositoryhas been removed. Instead newRelationQueryBuilderwas introduced.getEntitiesAndRawResultsofQueryBuilderhas been renamed togetRawAndEntities.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.
@PrimaryGeneratedColumndecorator now accept generation strategy as first argument (default isincrement), instead of column type. Column type must be passed in options object, e.g.@PrimaryGeneratedColumn({ type: "bigint"}).@PrimaryColumnnow does not acceptgeneratedparameter in options. Use@Generatedor@PrimaryGeneratedColumndecorators instead.Logger interface has changed. Custom logger supply mechanism has changed.
Now
loggingoptions in connection options is simple "true", or "all", or list of logging modes can be supplied.removed
driversection in connection options. Define options right in the connection options section.Embeddeddecorator is deprecated now. use@Column(type => SomeEmbedded)instead.schemaNamein connection options is removed. Useschemainstead.TYPEORM_AUTO_SCHEMA_SYNCenv variable is now calledTYPEORM_SYNCHRONIZE.schemaSyncmethod inConnectionhas been renamed tosynchronize.getEntityManagerhas been deprecated. UsegetManagerinstead.@TransactionEntityManageris now called@TransactionManagernow.EmbeddableEntity,Embedded,AbstractEntitydecorators has been removed. There is no need to useEmbeddableEntityandAbstractEntitydecorators 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,dropSchemaOnConnectionoptions were removed. UseentityPrefix,synchronize,migrationsRun,dropSchemaoptions instead.removed
persistmethod from theRepositoryandEntityManager. Usesavemethod instead.removed
getEntityManagerfromtypeormnamespace. UsegetManagermethod instead.refactored how query runner works, removed query runner provider
renamed
TableSchemaintoTablerenamed
ColumnSchemaintoTableColumnrenamed
ForeignKeySchemaintoTableForeignKeyrenamed
IndexSchemaintoTableIndexrenamed
PrimaryKeySchemaintoTablePrimaryKey
NEW FEATURES
added
mongodbsupport.entity now can be saved partially within
updatemethod.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,.xmlformats.all database-specific types are supported now.
now migrations generation in mysql is supported. Use
typeorm migrations:generatecommand.getGeneratedQuerywas renamed togetQueryinQueryBuilder.getSqlWithParameterswas renamed togetSqlAndParametersinQueryBuilder.sql queries are highlighted in console.
added
@Generateddecorator. It can acceptstrategyoption with valuesincrementanduuid. Default isincrement. It always generates value for column, except when column defined asnullableand user setsnullvalue in to column.added logging of log-running requests.
added replication support.
added custom table schema and database support in
Postgres,MysqlandSql Serverdrivers.multiple bug fixes.
added ActiveRecord support (by extending BaseEntity) class
Connectionhow hascreateQueryRunnerthat can be used to control database connection and its transaction stateQueryBuilderis abstract now and all different kinds of query builders were created for different query types -SelectQueryBuilder,UpdateQueryBuilder,InsertQueryBuilderandDeleteQueryBuilderwith individual method available.
0.0.11
fixes #341 - issue when trying to create a
OneToOnerelation withreferencedColumnNamewhere the relation is not between primary keys
0.0.10
added
ObjectLiteralandObjectTypeinto main exportsfixed issue fixes #345.
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 issue.
0.0.9
fixed bug with indices from columns are not being inherited from parent entity #242
added support of UUID primary columns (thanks @seanski)
added
countmethod to repository and entity manager (thanks @aequasi)
0.0.8
added complete babel support
added
clearmethod toRepositoryandEntityManagerwhich allows to truncate entity tableexported
EntityRepositoryintypeorm/indexfixed issue with migration generation in #239 (thanks to @Tobias4872)
fixed issue with non-pooled connections #234 (thanks to @benny-medflyt)
0.0.7
added custom entity repositories support
merged typeorm-browser and typeorm libraries into single package
added
@Transactiondecoratoradded exports to
typeorm/indexfor naming strategiesadded shims for browsers using typeorm in frontend models, also added shim to use typeorm with class-transformer library on the frontend
fixed issue when socketPath could not be used with mysql driver (thanks @johncoffee)
all table decorators are renamed to
Entity(Table=>Entity,AbstractTable=>AbstractEntity,ClassTableChild=>ClassEntityChild,ClosureTable=>ClosureEntity,EmbeddableTable=>EmbeddableEntity,SingleTableChild=>SingleEntityChild). This change is required because upcoming versions of orm will work not only with tables, but also with documents and other database-specific "tables". Previous decorator names are deprecated and will be removed in the future.added custom repositories support. Example in samples directory.
cascade remove options has been removed from
@ManyToMany,@OneToManydecorators. Also cascade remove is not possible from two sides of@OneToOnerelationship now.fixed issues with subscribers and transactions
typeorm now has translation in chinese (thanks @brookshi)
added
schemaNamesupport for postgres database #152 (thanks @mingyang91)fixed bug when new column was'nt added properly in sqlite #157
added ability to set different types of values for DEFAULT value of the column #150
fixed bug with junction tables persistence (thanks @Luke265)
fixed bug regexp in
QueryBuilder(thanks @netnexus)fixed issues #202, #203 (thanks to @mingyang91)
0.0.6
added
JSONBsupport for Postgres in #126 (thanks @CreepGin@CreepGin)fixed in in sqlite query runner in #141 (thanks @marcinwadon)
added shortcut exports for table schema classes in #135 (thanks @eduardoweiland)
fixed bugs with single table inheritance in #132 (thanks @eduardoweiland)
fixed issue with
TIMEcolumn in #134 (thanks @cserron)fixed issue with relation id in #138 (thanks @mingyang91)
fixed bug when URL for pg was parsed incorrectly #114 (thanks @mingyang91)
fixed bug when embedded is not being updated
metadata storage now in global variable
entities are being loaded in migrations and can be used throw the entity manager or their repositories
migrations now accept
EntityMetadatawhich can be used within one transactionfixed issue with migration running on windows #140
fixed bug with with Class Table Inheritance #144
0.0.5
changed
getScalarManytogetRawManyinQueryBuilderchanged
getScalarOnetogetRawOneinQueryBuilderadded migrations support
0.0.4
fixed problem when
order byis used withlimitfixed problem when
decorators-shim.d.tsexist 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 relationscascade operations should work better now
optimized all queries
entities with recursive entities should be persisted correctly now
now
undefinedproperties are skipped in the persistence operation, as well asundefinedrelations.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 togetOne()getResults()renamed togetMany()getResultsAndCount()renamed togetManyAndCount()in the innerJoin*/leftJoin* methods now no need to specify
ONin the innerJoin*/leftJoin* methods no longer supports parameters, use
addParametersorsetParameterinstead.setParametersis now works just likeaddParameters(because previous behaviour confused users),addParametersnow is deprecatedgetOnereturnsPromise<Entity|undefined>
breaking changes in
RepositoryandEntityManager:findOneand .findOneByIdnow returnPromise<Entity|undefined>instead ofPromise`
now typeorm is compiled into
ES5instead ofES6- this allows to run it on older versions of node.jsfixed 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
Last updated
Was this helpful?