fix(deps): update dependency typeorm to ^0.3.0 #62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.2.31->^0.3.0Release Notes
typeorm/typeorm
v0.3.6Compare Source
Features
for_key_share("FOR KEY SHARE") lock mode for postgres driver (#8879) (4687be8), closes #8878v0.3.5Compare Source
Bug Fixes
.saverepository method not returning generated uuids for aurora-postgres (#8825) (ed06f4c)cli-ts-node-commonjsandcli-ts-node-esmon some linux distros (#8821) (c5dfc11), closes #8818typeorm initcommand (#8820)v0.3.4Compare Source
Bug Fixes
findOneto throw error on missing conditions in runtime (#8801) (ee8c1ec)Features
v0.3.3Compare Source
Bug Fixes
Features
v0.3.2Compare Source
Bug Fixes
Features
ts-node(#8776) (05fc744)Reverts
v0.3.1Compare Source
Bug Fixes
Features
ArrayContains,ArrayContainedBy,ArrayOverlap) (#8766) (9f1b8e3):BREAKING CHANGES
v0.3.0Compare Source
Changes in the version includes changes from the
nextbranch andtypeorm@nextversion.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.Old
Connectionis still there, but now it's deprecated. It will be completely removed in next version.New API:
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.
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 andQueryBuilder. Value can be set tojoinorquery.join- loads relations using SQLJOINexpressionquery- executes separate SQL queries for each relationDefault is
join, but default can be set inConnectionOptions:Also, it can be set per-query in
find*methods:And QueryBuilder:
For queries returning big amount of data, we recommend to use
querystrategy,because it can be a more performant approach to query relations.
findOneBy,findOneByOrFail,findBy,countBy,findAndCountBymethods toBaseEntity,EntityManagerandRepository:Overall
find*andcount*method signatures where changed, read the "breaking changes" section for more info.selecttype signature inFindOptions(used infind*methods):Also, now it's possible to specify select columns of the loaded relations:
relationstype signature inFindOptions(used infind*methods):To load nested relations use a following signature:
ordertype signature inFindOptions(used infind*methods):Now supports nested order by-s:
wheretype signature inFindOptions(used infind*methods) now allows to build nested statements with conditional relations, for example:Gives you users who have photos in their "profile" album.
FindOperator-s can be applied for relations inwherestatement, for example:Gives you users with more than 10 photos.
booleancan be applied for relations inwherestatement, for example: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 in
0.4.0.If you want to have your connection options defined in a separate file, you can still do it like this:
Or even more type-safe approach with
resolveJsonModuleintsconfig.jsonenabled:But we do not recommend use this practice, because from
0.4.0you'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
ormconfigextensions (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
@Entitydecorator.Also, for junction table it's possible to set a custom name using
@JoinTabledecorator.findOne()signature without parameters was dropped.If you need a single row from the db you can use a following syntax:
This change was made to prevent user confusion.
See this issue for details.
findOne(id)signature was dropped. Use following syntax instead: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.:To supply
whereconditions directly withoutFindOptionsnew methods were added:findOneBy,findOneByOrFail,findBy,countBy,findAndCountBy. Example:This change was required to simply current
find*andcount*methods typings,improve type safety and prevent user confusion.
findByIdswas deprecated, usefindBymethod instead in conjunction withInoperator, for example: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 return
null.findOnenow limits returning rows to 1 at database level.NOTE:
FOR UPDATElocking does not work withfindOnein Oracle sinceFOR UPDATEcannot be used withFETCH NEXTin 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 use
IsNull()operator.Before:
After:
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.
then you won't be able to use it in
find*'swhere. Example:Before for the
@Column(/*...*/) membership: MembershipKindyou could have a query like:now, you need to wrap this value into
Equaloperator:This change is due to type-safety improvement new
wheresignature 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,
and
stringdoesn't make sense in the context ofFindOptions. UseQueryBuilderinstead.MongoRepositoryandMongoEntityManagernow use new types calledMongoFindManyOptionsandMongoFindOneOptionsfor 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:
Now:
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:
This 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:
New way of loading entity relations:
This change is due to type-safety improvement new
selectsignature 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:
New way of loading entity relations:
This change is due to type-safety improvement new
relationssignature 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 databasesimply do:
getConnection()is deprecated. To have a globally accessible connection, simply export your data source and use it in places you need it:getManager(),getMongoManager(),getSqljsManager(),getRepository(),getTreeRepository(),getMongoRepository(),createQueryBuilder()are all deprecated now. Use globally accessible data source instead:
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:
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.0EXPERIMENTAL 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.v0.2.45Compare Source
Bug Fixes
Features
v0.2.44Compare Source
Bug Fixes
Features
{delete,insert}().returning()on MariaDB (#8673) (7facbab), closes #7235 #7235v0.2.43Compare Source
Bug Fixes
requireto internal files without explicitly writing.jsin the path (#8660) (96aed8a), closes #8656Features
Reverts
v0.2.42Compare Source
Bug Fixes
uuidlibrary (#8642) (8898a71)update: falsecolumns shouldn't trigger @UpdateDateColumn column updation (2834729), closes #8394 #8394 #8394Features
Reverts
BREAKING CHANGES
v0.2.41Compare Source
Bug Fixes
retryWritestoMongoConnectionOptions(#8354) (c895680), closes #7869UNIQUEconstraints detection (#8364) (29cb891), closes #8158Features
v0.2.40Compare Source
Bug Fixes
Features
Reverts
v0.2.39Compare Source
Bug Fixes
Features
typeormcommand wrapper to package.json in project template (#8081) (19d4a91)Reverts
v0.2.38Compare Source
Bug Fixes
Features
v0.2.37Compare Source
Bug Fixes
connectionsproperty should include list ofConnections (#8004) (2344db6)Features
v0.2.36Compare Source
Bug Fixes
WhereExpressionalias forWhereExpressionBuilder(#7980) (76e7ed9)browserpackage manifests (#7982) (0d90bcd)Features
applicationName(#7989) (d365acc)v0.2.35Compare Source
Bug Fixes
entityto bePartial<Entity>|undefinedinUpdateEvent(#7783) (f033045)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled due to failing status checks.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.