Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

chore(deps): update dependency typeorm to v0.3.17 #50

Open
wants to merge 1 commit into
base: ayuskey
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Dec 3, 2022

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
typeorm (source) ^0.2.34 -> ^0.2.34 || ^0.3.0 age adoption passing confidence
typeorm (source) 0.2.45 -> 0.3.17 age adoption passing confidence

Release Notes

typeorm/typeorm (typeorm)

v0.3.17

Compare Source

Bug Fixes

v0.3.16

Compare Source

Bug Fixes
Features
Reverts

v0.3.15

Compare Source

Bug Fixes
  • make cache optional fields optional (#​9942) (159c60a)
  • prevent unique index identical to primary key (all sql dialects) (#​9940) (51eecc2)
  • SelectQueryBuilder builds incorrectly escaped alias in Oracle when used on entity with composite key (#​9668) (83c6c0e)
Features

v0.3.14

Compare Source

Bug Fixes
  • drop xml & yml connection option support. Addresses security issues in underlying dependency (#​9930) (7dac12c)
Features

v0.3.13

Compare Source

Bug Fixes
Features

v0.3.12

Compare Source

Bug Fixes
Features

v0.3.11

Compare Source

Fixes
Features

v0.3.10

Compare Source

Bug Fixes
Features

v0.3.9

Compare Source

v0.3.8

Compare Source

Bug Fixes
Features

v0.3.7

Compare Source

Bug Fixes
Features
Performance Improvements

v0.3.6

Compare Source

Features

v0.3.5

Compare Source

Bug Fixes

v0.3.4

Compare Source

Bug Fixes
Features

v0.3.3

Compare Source

Bug Fixes
  • improve initialization of custom repository (#​8782) (52a641c)
  • resolve entities correctly in datasource when globs are specified (#​8778) (a641c5d)
Features

v0.3.2

Compare Source

Bug Fixes
Features
Reverts

v0.3.1

Compare Source

Bug Fixes

v0.3.0

Compare Source

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 target now is es2020. This requires Node.JS version 14+

  • 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)

  • Connection was renamed to DataSource.
    Old Connection is 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 on find* methods and QueryBuilder. Value can be set to join or query.

    • join - loads relations using SQL JOIN expression
    • query - 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, findAndCountBy methods to BaseEntity, EntityManager and Repository:
const users = await userRepository.findBy({
    name: "Michael"
})

Overall find* and count* method signatures where changed, read the "breaking changes" section for more info.

  • new select type signature in FindOptions (used in find* 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 relations type signature in FindOptions (used in find* 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 order type signature in FindOptions (used in find* methods):
userRepository.find({
    order: {
        id: "ASC"
    }
})

Now supports nested order by-s:

userRepository.find({
    order: {
        photos: {
            album: {
                name: "ASC"
            },
        },
    }
})
  • new where type signature in FindOptions (used in find* 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 in where statement, for example:
userRepository.find({
    where: {
        photos: MoreThan(10),
    }
})

Gives you users with more than 10 photos.

  • boolean can be applied for relations in where statement, for example:
userRepository.find({
    where: {
        photos: true
    }
})
BREAKING CHANGES
  • minimal Node.JS version requirement now is 14+

  • drop ormconfig support. ormconfig still 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:

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. Use migration:* commands instead.

  • all commands were re-worked. Please refer to new CLI documentation.

  • cli option from BaseConnectionOptions (now BaseDataSourceOptions options) 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 migrationsRun and synchronize enabled in connection options).

  • aurora-data-api driver now is called aurora-mysql

  • aurora-data-api-pg driver now is called aurora-postgres

  • EntityManager.connection is now EntityManager.dataSource

  • Repository now has a constructor (breaks classes extending Repository with custom constructor)

  • @TransactionRepository, @TransactionManager, @Transaction decorators 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 tab


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot changed the title chore(deps): update dependency typeorm to v0.3.11 Update dependency typeorm to v0.3.11 Dec 17, 2022
@renovate renovate bot changed the title Update dependency typeorm to v0.3.11 chore(deps): update dependency typeorm to v0.3.11 Dec 17, 2022
@renovate renovate bot changed the title chore(deps): update dependency typeorm to v0.3.11 chore(deps): update dependency typeorm to v0.3.12 Apr 3, 2023
@renovate renovate bot changed the title chore(deps): update dependency typeorm to v0.3.12 chore(deps): update dependency typeorm to v0.3.12 - autoclosed Apr 4, 2023
@renovate renovate bot closed this Apr 4, 2023
@renovate renovate bot deleted the renovate/typeorm-0.x branch April 4, 2023 00:09
@renovate renovate bot changed the title chore(deps): update dependency typeorm to v0.3.12 - autoclosed chore(deps): update dependency typeorm to v0.3.12 Apr 4, 2023
@renovate renovate bot reopened this Apr 4, 2023
@renovate renovate bot restored the renovate/typeorm-0.x branch April 4, 2023 09:44
@renovate renovate bot changed the title chore(deps): update dependency typeorm to v0.3.12 chore(deps): update dependency typeorm to v0.3.16 May 31, 2023
@renovate renovate bot changed the title chore(deps): update dependency typeorm to v0.3.16 chore(deps): update dependency typeorm to v0.3.17 Jun 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants