mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
18 KiB
18 KiB
Changelog
TypeORM follows a semantic versioning and until 1.0.0 breaking changes may appear in 0.x.x versions,
however since API is already quite stable we don't expect too much breaking changes.
If we missed a note on some change or you have a questions on migrating from old version,
feel free to ask us and community.
0.1.1 (next)
- 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. - removed opencollective dependency
- 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-array- some 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
TableSchemaintoTable - renamed
ColumnSchemaintoTableColumn - renamed
ForeignKeySchemaintoTableForeignKey - renamed
IndexSchemaintoTableIndex - renamed
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 exports - fixed 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 table - exported
EntityRepositoryintypeorm/index - fixed issue with migration generation in #239 (thanks to @Tobias4872)
- fixed issue with using extra options with SqlServer #236 (thanks to @jmai00)
- fixed issue with non-pooled connections #234 (thanks to @benny-medflyt)
- fixed issues: #242, #240, #204, #219, #233, #234
0.0.7
- added custom entity repositories support
- merged typeorm-browser and typeorm libraries into single package
- added
@Transactiondecorator - added exports to
typeorm/indexfor naming strategies - added 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
- added ability to use zero, false and empty string values as DEFAULT values in #189 (thanks to @Luke265)
- fixed bug with junction tables persistence (thanks @Luke265)
- fixed bug regexp in
QueryBuilder(thanks @netnexus) - fixed issues #202, #203 (thanks to @mingyang91)
- fixed issues #159, #181, #176, #192, #191, #190, #179, #177, #175, #174, #150, #159, #173, #195, #151
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 transaction - fixed issue with migration running on windows #140
- fixed bug with with Class Table Inheritance #144
0.0.5
- changed
getScalarManytogetRawManyinQueryBuilder - changed
getScalarOnetogetRawOneinQueryBuilder - added migrations support
0.0.4
- fixed problem when
order byis used withlimit - fixed 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 relations - cascade operations should work better now
- optimized all queries
- entities with recursive entities should be persisted correctly now
- added experimental support of
- 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
ON - in 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:findOneandfindOneByIdnow returnPromise<Entity|undefined>instead ofPromise<Entity>
- now typeorm is compiled into
ES5instead ofES6- 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