@synconset/typeorm
Advanced tools
Changelog
Changelog
0.1.0
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.find*
repository methods. Now conditions are Partial<Entity>
type.FindOptions
interface and introduced two new interfaces: FindOneOptions
and FindManyOptions
- each for its own findOne*
or find*
methods.FindOptions
. Use QueryBuilder
instead. However, added few new options as well.addParameters
has been removed from QueryBuilder
. Use setParameters
instead.setMaxResults
, setFirstResult
methods in QueryBuilder
. Use take
and skip
methods instead.entityManager
to manager
in Connection
, AbstractRepository
and event objects. entityManager
property was removed.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.driver
section in connection options now deprecated. All settings should go directly to connection options root.fromTable
from the QueryBuilder
. Now use regular from
to select from tables.usePool
option from the connection options. Pooling now is always enabled.storage
in sqlite options has been renamed to database
.TYPEORM_DRIVER_TYPE
has been renamed to TYPEORM_CONNECTION
, some other renaming). More env variable names you can find in ConnectionOptionsEnvReader
class.ConnectionManager
and createConnection
/ createConnections
methods of typeorm main entrypoint.simple_array
column type now is called simple-array
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.up
and down
accept only QueryRunner
. To use Connection
and EntityManager
use properties of QueryRunner
, e.g. queryRunner.connection
and queryRunner.manager
.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
.@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.logging
options in connection options is simple "true", or "all", or list of logging modes can be supplied.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.persist
method from the Repository
and EntityManager
. Use save
method instead.getEntityManager
from typeorm
namespace. Use getManager
method instead.TableSchema
into Table
ColumnSchema
into TableColumn
ForeignKeySchema
into TableForeignKey
IndexSchema
into TableIndex
PrimaryKeySchema
into TablePrimaryKey
mongodb
support.update
method..env
, .js
, .json
, .yml
, .xml
formats.typeorm migrations:generate
command.getGeneratedQuery
was renamed to getQuery
in QueryBuilder
.getSqlWithParameters
was renamed to getSqlAndParameters
in QueryBuilder
.@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.Postgres
, Mysql
and Sql Server
drivers.Connection
how has createQueryRunner
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
and DeleteQueryBuilder
with individual method available.