5102 Commits

Author SHA1 Message Date
Bikram Suwal
b5ff79fc3f
docs: fix decorator for @AfterRecover() (#9504)
### `@AfterRecover`

You can define a method with any name in the entity and mark it with `@AfterRecover`
and TypeORM will call it after the entity is recovered using repository/manager `recover`.
Example:

```typescript
@Entity()
export class Post {
    @AfterRecover()
    updateStatus() {
        this.status = "recovered"
    }
}
```
`@AfterSoftRemove()` should be `@AfterRecover`
2022-11-04 16:13:51 +05:00
Warwick
66acec8c0c
docs: update one-to-one-relations.md (#9456)
One to one documentation is referring to the wrong entity
2022-11-04 15:58:14 +05:00
Geonu Lim
1194448fc5
docs: fix typo in readme_ko.md (#9448)
Fixed wrong typo!
2022-11-04 15:57:19 +05:00
dependabot[bot]
8883235994
build(deps): bump @xmldom/xmldom from 0.7.5 to 0.7.8 (#9514)
Bumps [@xmldom/xmldom](https://github.com/xmldom/xmldom) from 0.7.5 to 0.7.8.
- [Release notes](https://github.com/xmldom/xmldom/releases)
- [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xmldom/xmldom/compare/0.7.5...0.7.8)

---
updated-dependencies:
- dependency-name: "@xmldom/xmldom"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-04 15:55:16 +05:00
Karim
ab7ed9c758
docs: fix typo in migrations doc (#9499)
Datasoure ==> Datasource
2022-11-04 15:53:45 +05:00
Rlok
f9a961265e
docs: fix typo of AfterRecover example (#9513) 2022-11-04 15:53:23 +05:00
Simon Garner
1903af741d
docs: add typeorm-relations to Extensions section (#9521) 2022-11-04 15:52:25 +05:00
Julian Pömp
cdabaa3028
fix: synchronize with typeorm_metadata table only if needed (#9175)
* fix: create typeorm metadata table before migration, if not exists

Creating a view in a migration results in an error: `QueryFailedError:
relation "typeorm_metadata" does not exist` (see #9173). This fix
creates the table before a migration runs.

Closes: #9173

* refactor: use function from RdbmsSchemaBuilder to create typeorm_metadata table

* test: add test for fix issue #9173

* test: replace describe.only() with describe()

* refactor: apply suggestions from review

* refactor: add syncWithMetadata param to createView function

* style: run npm format

* removed only test

* test: add missing syncWithMetaData parameter in create-view.ts

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
2022-09-20 17:27:42 +05:00
Collin
d305e5f9ac
feat: new virtual column decorator (#9339)
* feat: implement new calculated decorator

This new feature change bahviour of typeorm to allow use new calculated decorator

Closes #9323

* feat: implement new virtual decorator

This new feature change bahviour of typeorm to allow use new virtual decorator

Closes typeorm#9323

* feat: Implement new virtual decorator

This new feature change bahviour of typeorm to allow use new virtual decorator

Closes typeorm#9323

* feat: implement new virtual decorator

This new feature change bahviour of typeorm to allow use new calculated decorator

Closes typeorm#9323

* feat: implement new virtual decorator

This new feature change behavior of typeorm to allow use of the new virtual column decorator

Closes typeorm#9323
2022-09-20 17:23:38 +05:00
Umed Khudoiberdiev
8a837f9626 fixed cockroachdb version upgrade issues 2022-09-20 17:03:00 +05:00
Umed Khudoiberdiev
dbc1b2e6f9 version bump 0.3.10 2022-09-19 21:28:59 +05:00
Jannik Mewes
de15df14ed
feat: orphanedRowAction=disabled (rebase of PR 8285) (#8678)
* updated implementation, using "disable" keyword

* rebase test restructure

* rebase orphanedRowAction tests with keyword "disabled"

* rename test suite files to reflect changed naming: skip -> disable
Simplify test suite to comply with postgres12

* Update tests to reflect 0.3 breaking changes

* prettied

Co-authored-by: Jannik <jannik@jannikmewes.de>
2022-09-19 21:22:57 +05:00
Brice Miclo
749809a42a
fix: "Cannot commit, no transaction is active" error in sql.js (#9234)
* fix: fix "Cannot commit, no transaction is active" error in sql.js

Closes: #9100

* Flush database only if transaction is done

Co-authored-by: Brice Miclo <brice.miclo@socomec.com>
2022-09-19 21:15:06 +05:00
Gabriel Kim
83f7b88387
fix: malformed query when selecting deeply nested embedded entities (#9273)
Update `SelectQueryBuilder.buildSelect` method to correctly build the property path for deeply nested embedded entities
2022-09-19 21:14:03 +05:00
Morteza PRK
48976c2967
feat: unify Pool max connection size in supported Drivers (#9305)
Added `poolSize` option everywhere to controll pool option

Closes: #3388

Co-authored-by: mortzprk <mortz.prk@gmail.com>
2022-09-19 21:10:02 +05:00
Jacob Lauritzen
f24b26202b
feat: update db image versions in docker compose (#9367)
* feat: update db image versions in docker compose

closes #9326

* Fix postgres version

* Upgrade Docker compose versions

* Fix docker compose version
2022-09-19 18:07:58 +05:00
Umed Khudoiberdiev
f943e61be9 removed only test 2022-09-19 18:05:30 +05:00
janzipek
a917d657fb
fix: Update RelationIdLoader to use DriverUtils.getAlias (#9380)
Update RelationIdLoader to use DriverUtils.getAlias to prevent aliases being possibly trimmed by database.

Closes: #9379

Co-authored-by: Jan Zípek <jan@zipek.cz>
2022-09-19 18:04:30 +05:00
Hannes Van De Vreken
6bc723bba9
refactor: docblock (#9384) 2022-09-19 18:01:02 +05:00
Regev Brody
a1960e1125
fix: typescript 4.8 type issues #9331 (#9357) 2022-09-15 15:45:07 +05:00
gustavomick
773a4fe439
feat: sqlite - deferrable options for foreign keys (#9360) 2022-09-14 23:10:20 +05:00
Umed Khudoiberdiev
52e5f7c3e2
chore: update LICENSE (#9371) 2022-09-14 22:51:28 +05:00
AlexMesser
cc639610dc
fix: add missing support for primaryKeyConstraintName property in EntitySchema
adds missing support for primaryKeyConstraintName property in EntitySchema definition;
adds tests for another custom constraint names in EntitySchema definition;
2022-08-30 21:44:48 +05:00
Umed Khudoiberdiev
e3aac27031 fix: prototype pollution issue 2022-08-29 23:22:58 +05:00
Umed Khudoiberdiev
ed1f0b95c6 version bump 0.3.9 2022-08-28 23:32:30 +05:00
Umed Khudoiberdiev
6beedfdc89 version bump 2022-08-28 23:29:35 +05:00
rbnayax
03317a3873
fix: bug introduced in CLI (#9332)
* fix: #9330
2022-08-28 23:14:24 +05:00
Taylor Hakes
68e8f22894
feat: add setOnLocked for SKIP LOCKED and NOWAIT (#9317) 2022-08-26 00:24:16 +05:00
Ahmed Osama Ibrahim
340ab67b10
feat: add fake migrations running and reverting (#8976)
* feat: add fake migrations running and reverting

Added a cli option to fake-run or fake-revert a migration, adding to the
executed migrations table, but not actually running it. This feature is
useful for when migrations are added after the fact or for
interoperability between applications which are desired to each keep
a consistent migration history

Closes: #6195

* changed enabled drivers in test

* added docs to the property

* fixed lint issue

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
2022-08-25 20:17:28 +05:00
Ahmed Osama Ibrahim
5e5abbd148
fix: resolve FindOptionsOrder.nulls to allow FIRST/LAST in uppercase (#8978)
* fix: resolve FindOptionsOrder.nulls issue to accept FIRST/LAST in uppercase

Closes #8970

* fixed failing test

Co-authored-by: Alex Messer <dmzt08@gmail.com>
2022-08-25 19:50:11 +05:00
Stefan Aebischer
72728f155d
fix: allow where IsNull for ManyToOne relations (#9031)
* fix: allow where IsNull for ManyToOne relations

Closes: #8890

* fix direct FindOperator queries on MTO relation

* fix: allow FindOperator queries on OTO owner column

* chore: prettier formating
2022-08-25 19:07:06 +05:00
Joren Vandeweyer
88d0ced812
fix: QueryBuilder update handles Date objects wrong on a ManyToOne relationship (#8748)
* fixes #8747

* apply fix again

* added test for issue 8747

* format

* remove .only

* only use postgres driver

* fixed test

* removed createDateColumn

* sqlite does not support timestamp type

* fix typo

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
Co-authored-by: Alex Messer <dmzt08@gmail.com>
2022-08-25 19:01:40 +05:00
Philip Thrasher
b8d04dc3f9
fix: sqlite temporary tables now honor withoutRowid (#8431)
* fix: sqlite temporary tables now honor withoutRowid

Closes: #8430

* merge master

* fixed `withoutRowid` on table recreation;
added test;

Co-authored-by: Thrasher <thrasher@grayshift.com>
Co-authored-by: Alex Messer <dmzt08@gmail.com>
2022-08-25 18:29:16 +05:00
John
c4f46506d8
fix: change postgres driver version checking query (#9319)
* fix #9318

fix: change postgres driver version checking query

Change the postgres `SHOW server_version` query to use `SELECT version()` which adds compatibility with AWS Redshift database

Closes: #9318

* git-issue 9318: remove describe from only in test

* fix-9318: prettier format test
2022-08-25 17:40:12 +05:00
Kevin KONRAD
36718876f9
fix: handle inherited relations insert order (#9321)
Fix forgot comparison operator in #9242

Closes: #9241

Co-authored-by: Kevin KONRAD <ext.kevin.konrad@reseau.sncf.fr>
2022-08-25 17:35:16 +05:00
Umed Khudoiberdiev
7198a7a732
Revert "feat: add array parameter on groupBy (#9243)" (#9320)
This reverts commit 77866d85d20991930f55000cd5d4e340c68930b4.
2022-08-24 22:49:15 +05:00
Frank Chan
dadb658c59
feat: add support for non-generated columns with uuid_generate_v4() default (#9065)
* fix: support postgres column with varchar datatype and uuid_generate_v4() default

Closes: #9063

* added test

Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
2022-08-24 22:02:21 +05:00
Bryan Fox
eb8f0c6c04
fix: pass error to pgpool release (#9209)
This extends github PR #7792 to pass the error, if any, to the release
callback from `pg-pool`. This should be done to ensure the connection is
removed from the pool, as described in #5112.
2022-08-24 21:59:13 +05:00
BitDesert
51a0ebe5f2
feat: new mssql option appName (#9213) 2022-08-24 21:56:51 +05:00
Dmitry Guketlev
f045536f24
fix: entity manager remove using entity schemas (#9221)
Currently the entity manager remove method does not recognize the first param if it is an entity schema.
2022-08-24 21:47:19 +05:00
Mihai Crisan
8dcd61e0a3
docs: query-runner.md typos (#9228) 2022-08-24 21:44:52 +05:00
Mohamed Akram
d8e5f3b086
docs: correct mssql encrypt default value (#9232) 2022-08-24 21:42:50 +05:00
Zach Tindall
72a0147f31
fix: update date utils to parse year correctly for years 1-999 (#9236)
* fix: update date utils to parse year correctly for years 1-999

Closes: #9230

* fix: commit change to date utils

* fix: default total length to 2
2022-08-24 21:42:00 +05:00
Brice Miclo
bb07244b61
fix: allow space and no-space syntaxes for SQLite constraints (#9238)
Closes #9237

Co-authored-by: Brice Miclo <brice.miclo@socomec.com>
2022-08-24 21:39:12 +05:00
Kevin KONRAD
14dfadbde9
fix: handle inherited relations insert order (#9242)
Take inheritance into consideration when sorting insert commands

Closes: #9241

Co-authored-by: Kevin KONRAD <ext.kevin.konrad@reseau.sncf.fr>
2022-08-24 21:38:01 +05:00
MURAKAMI Masahiko
e51991076d
fix: don't use temporary table name to create foreign key, unique, check constraint with SQLite (#9185)
* fix: don't use temporary table name to create foreign key, unique, check constraint with SQLite

In migration steps, finally temporary table name is renamed to original table name. these constraints name should be created from original table name not temporary table name.

Closes: #9176

* style: remove unnecessary comment
2022-08-24 21:37:45 +05:00
wirekang
77866d85d2
feat: add array parameter on groupBy (#9243)
* feat: add array parameter on groupBy

* docs: add groupBy(string[])
2022-08-24 21:36:24 +05:00
Lucas Rangel
a98ca8bf97
docs: text on data-source setup section (#9244)
On line 73 have 'three options' to setup, but is actually only two as you can see.
2022-08-24 21:35:13 +05:00
Hyunji Song
e49d0c8740
fix: find query mongodb properly with @DeleteDateColumn() (#9262)
* fix: use existing query and filter deleted data

* test: add mongo-repository query test with DeleteDateColumn

* style: lint MongoEntityManager

* fix: not override $or with query.$or

* test: not override query.$or
2022-08-24 21:11:07 +05:00
Dmitry Zotov
90ce28591b fixed failing test 2022-08-24 21:09:16 +05:00