Table
,AbstractTable
,ClassTableChild
,ClosureTable
,EmbeddableTable
,SingleTableChild
deprecated decorators has been removed. UseEntity
,ClassEntityChild
,ClosureEntity
,SingleEntityChild
decorators instead.EntityManager#create
andRepository#create
,EntityManager#preload
andRepository#preload
methods now acceptDeepPartial<Entity>
instead ofObject
EntityManager#merge
andRepository#merge
methods now acceptsDeepPartial<Entity>
instead ofObject
, also their first argument is an entity where to need to merge all given entity-like objects.- changed
find*
repository methods. Now conditions arePartial<Entity>
which makes them type-safe. However nowFindOptions
cannot be used withfindOne
,findAndCount
,find
and other methods. UsefineOneByOptions
,findAndCountByOptions
,findByOptions
methods instead - removed
FindOptions
interface and introduced two new interfaces:FindOneOptions
andFindManyOptions
- each for its ownfindOne*
orfind*
methods - dropped out some of options of
FindOptions
. UseQueryBuilder
instead. - deprecated method
addParameters
has been removed fromQueryBuilder
. UsesetParameters
instead. - table decorators were not removed in the release, however they will be removed in next. Be sure to replace them before that.
QueryBuilder#setFirstResult
has been renamed toQueryBuilder#skip
QueryBuilder#setMaxResults
has been renamed toQueryBuilder#take
- renamed
entityManager
tomanager
inConnection
,AbstractRepository
and event objects - renamed
persist
tosave
inEntityManager
andRepository
objects SpecificRepository
is removed. Use relational query builder instead.transaction
method has been removed fromRepository
. UseEntityManager#transaction
method instead- custom repositories do not support container anymore
- added ActiveRecord support (by extending BaseEntity) class
- 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 theQueryBuilder
. Now use regularfrom
to select from tables - removed
usePool
option from the connection options - connection options interface has changed and now each platform has its own set of connection options
storage
in sqlite options has been renamed todatabase
- env variable names for connection were changed (
TYPEORM_DRIVER_TYPE
has been renamed toTYPEORM_CONNECTION
, some other renaming). More env variable names you can find inConnectionOptionsEnvReader
class. - some api changes in
ConnectionManager
andcreateConnection
/createConnections
methods of typeorm main entrypoint usePool
option has been removed from connection options. Now connections are working only with connection poolingsimple_array
column type now is calledsimple-array
- some column types were removed. Now orm uses directly column types of underlying database
- now
number
type in column definitions (like@Column() likes: number
) maps tointeger
instead ofdouble
as before. This is more programmatic design. If you need to store float-pointing values there 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 insteadlocalTimezone
has been removed from the column optionsskipSchemaSync
in entity options has been renamed toskipSync
setLimit
andsetOffset
inQueryBuilder
were renamed intolimit
andoffset
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
anddown
accept onlyQueryRunner
. To useConnection
andEntityManager
use properties ofQueryRunner
, e.g.queryRunner.connection
andqueryRunner.manager
- now
update
method inQueryBuilder
acceptsPartial<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 newRelationQueryBuilder
was introduced.getEntitiesAndRawResults
ofQueryBuilder
has 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. Also now all
- create and update dates in entities now use date with fractional seconds.
@PrimaryGeneratedColumn
decorator 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"})
@PrimaryColumn
now does not acceptgenerated
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)
insteadschemaName
in connection options is removed. Useschema
insteadTYPEORM_AUTO_SCHEMA_SYNC
env variable is now calledTYPEORM_SYNCHRONIZE
schemaSync
method inConnection
has been renamed tosynchronize
getEntityManager
has been deprecated. UsegetManager
instead.@TransactionEntityManager
is now called@TransactionManager
nowEmbeddableEntity
,Embedded
,AbstractEntity
decorators has been removed. There is no need to useEmbeddableEntity
andAbstractEntity
decorators at all - entity will work as expected without them. Instead of@Embedded(type => X)
decorator now@Column(type => X)
must be used insteadtablesPrefix
,autoSchemaSync
,autoMigrationsRun
,dropSchemaOnConnection
options were removed. UseentityPrefix
,synchronize
,migrationsRun
,dropSchema
options instead- removed
setMaxResults
,setFirstResult
methods inQueryBuilder
. Usetake
andskip
methods instead. - removed
persist
method from theRepository
andEntityManager
. Usesave
method instead. - removed
entityManager
property from theConnection
. Usemanager
property instead. - removed
getEntityManager
fromtypeorm
namespace. UsegetManager
method instead.
-
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 is supported. Use
typeorm migrations:generate
command -
getGeneratedQuery
was renamed togetQuery
inQueryBuilder
-
getSqlWithParameters
was renamed togetSqlAndParameters
inQueryBuilder
-
sql queries are highlighted in console
-
added
@Generated
decorator. It can acceptstrategy
option with valuesincrement
anduuid
. Default isincrement
. It always generates value for column, except when column defined asnullable
and user setsnull
value in to column. -
added logging of log-running requests
-
added replication support
-
added custom table schema and database support in
Postgres
,Mysql
andSql Server
drivers.Postgres
supports only custom table schemaMysql
supports only custom databaseSql Server
supports both custom table schema and custom database
This options can be specified in
ormconfig
file or directry in@Entity()
decorator, e.g@Entity({ database: "myDb", schema: "mySchema" })
- moved
query
,transaction
andcreateQueryBuilder
to theConnection
.EntityManager
now simply use them from the connection. - refactored how query runner works, removed query runner provider
- fixed some issues with sqlite, sqlite now strongly works on a single connection
Connection
how hascreateQueryRunner
that can be used to control database connection and its transaction stateQueryBuilder
is abstract now and all different kinds of query builders were created for different query types -SelectQueryBuilder
,UpdateQueryBuilder
,InsertQueryBuilder
andDeleteQueryBuilder
with individual method available.
- fixes #285 - issue when cli commands rise
CannotCloseNotConnectedError
- fixes #309 - issue when
andHaving
didn't work without callinghaving
onQueryBuilder
- fixes issues with default value being updated by schema sync
- fixes #341 - issue when trying to create a
OneToOne
relation withreferencedColumnName
where the relation is not between primary keys
- added
ObjectLiteral
andObjectType
into 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.
- fixed bug with indices from columns are not being inherited from parent entity #242
- added support of UUID primary columns (thanks @seanski)
- added
count
method to repository and entity manager (thanks @aequasi)
- added complete babel support
- added
clear
method toRepository
andEntityManager
which allows to truncate entity table - exported
EntityRepository
intypeorm/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
- added custom entity repositories support
- merged typeorm-browser and typeorm libraries into single package
- added
@Transaction
decorator - added exports to
typeorm/index
for 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
,@OneToMany
decorators. Also cascade remove is not possible from two sides of@OneToOne
relationship now. - fixed issues with subscribers and transactions
- typeorm now has translation in chinese (thanks @brookshi)
- added
schemaName
support 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
- added
JSONB
support 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
TIME
column 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
EntityMetadata
which can be used within one transaction - fixed issue with migration running on windows #140
- fixed bug with with Class Table Inheritance #144
- changed
getScalarMany
togetRawMany
inQueryBuilder
- changed
getScalarOne
togetRawOne
inQueryBuilder
- added migrations support
- fixed problem when
order by
is used withlimit
- 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
- 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
undefined
properties are skipped in the persistence operation, as well asundefined
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 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
addParameters
orsetParameter
instead. setParameters
is now works just likeaddParameters
(because previous behaviour confused users),addParameters
now is deprecatedgetOne
returnsPromise<Entity|undefined>
- breaking changes in
Repository
andEntityManager
:findOne
andfindOneById
now returnPromise<Entity|undefined>
instead ofPromise<Entity>
- now typeorm is compiled into
ES5
instead ofES6
- this allows to run it on older versions of node.js - fixed multiple issues with dates and utc-related stuff
- multiple bugfixes
- lot of API refactorings
- complete support TypeScript 2
- optimized schema creation
- command line tools
- multiple drivers support
- multiple bugfixes
- first stable version, works with TypeScript 1.x