759 Commits

Author SHA1 Message Date
StefanZivkovic
c418aae39a
docs: update cli related docs (#9659)
- remove cli.entitiesDir description
- remove cli.subscribersDir description
- remove cli from Data Source Options example
- extend migration:run examples with -- -d path-to-datasource-config
- extend migration:revert examples with -- -d path-to-datasource-config
- extend migration:show examples with -- -d path-to-datasource-config
- extend migration:create examples with path-to-migrations-dir/migrationName

Co-authored-by: Stefan <stefi@sprintingsoftware.com>
2023-02-07 12:34:37 +05:00
Vítor L. Brasil
ca315f0ad2
docs: Fix grammar error in the first paragraph. (#9759)
docs: Fix grammar (verbal agreement) error in the first paragraph.
2023-02-06 02:28:57 +05:00
Zeeshan Haider Khan
c669f50bdd
docs: update many-to-many-relations.md (#9736) 2023-01-28 21:00:14 +05:00
Mattias Fjellvang
defb409f56
feat: support time travel queries, upsert, enums, spatial types in cockroachdb (#9128)
* feature: adds support for enum type (fixes #9068)

* temporarily ran package to test on different repo

* playing around - bumped version

* Revert "playing around - bumped version"

This reverts commit 7df4adb3e698419c174c2daee88614f8dafdbb6c.

* Revert "temporarily ran package to test on different repo"

This reverts commit 48f394e8eb32c22fe757010b446c85740bf80b5f.

* feat: add support for geometry data type

* feature: properly hydrate enum array values

* feature: adds support for geography and geometry for cockroachdb

* bugfix: fixes issue with primary generated columns being invalid column type (fixes #8532)

* Revert "bugfix: fixes issue with primary generated columns being invalid column type (fixes #8532)"

This reverts commit e00cdb090638d34668e3e10acd5f8267fe3bd028.

* bugfix: type casts to string when using ANY

* feature: cast geometry/geography to geojson

* feature: added references to srid

* bugfix: prevent error if trying to close already closed connection

* feature: added cockrachodb as part of postgres family

* feature: ensures support for spatial columns for cockroachdb

* feature: adds support for UPSERT for CockroachDB (fixes #9199)

* minor: added TODO; unsure how to achieve this

* feature: adds support for time travelling queries for cockroachdb

* bugfix: only run time travel query on SELECT statements

* refactor: changed UsertType from 'upsert' to 'primary-key' since this is more logical

* feature: added posibility to set timeTravelQuery to false, instead of the parameter function; help for disabling time travel queries during tests

* feature: allow timeTravelQueries in find* queries

* bugfix: when using timetravel queries with joinAttributes it now prevents error 'AS OF SYSTEM TIME must be in top level' error

* lint

* minor fix

* fixed failing test

* implemented ENUM type;
added tests;

* fixed failing tests

* fixed failing test

* fixed spatial types synchronization;
implemented spatial indices;
added tests for spatial columns;

* refactored Time Travel Query functionality;
removed TTQ from find options;
added tests for TTQ;

* added docs for Time Travel Queries

* minor changes

* added GeoJSON types;
other minor fixes;

* updated docs

* updated docs

Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
2023-01-03 19:25:22 +05:00
Sho Ogawa
3e1caf0ff3
docs: fix some typo in migration document (#9667) 2023-01-03 13:12:24 +05:00
JesseNeon
ae91c050a4
docs: correct typo (#9643) 2022-12-27 14:09:52 +05:00
r-shirasu
648222a006
docs: correct typo (#9655) 2022-12-27 14:08:30 +05:00
Saad A. Bazaz
82518125e4
docs: fix missing ) (#9629) 2022-12-16 20:50:31 +05:00
Tim Beyer
6ba48bdc1b
feat: allow per-migration control over transaction behavior (#9459)
Closes #7087
2022-12-03 21:35:41 +05:00
Derek Bonner
2c54381815
feat: allow for partial index conditions for on conflict statments in postgres (#8971)
* feat: allow for partial index conditions for on conflict statments in postgres

* fix: change variable to match postgres documentation and convert from array to string type

* fix: generalize use of index predicate. add documentation and expand test cases

* lint fix

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
Co-authored-by: Alex Messer <dmzt08@gmail.com>
2022-12-03 21:11:10 +05:00
Bartłomiej Rutkowski
93e14a928b
feat: Add synchronize to @JoinTable (#9442)
* feat: Add synchronize option to @JoinTable

Add synchronize option to @JoinTable. It allows to ignore JoinTable when syncing and generating migrations.

Closes #3443

* removed only

* lint fix

Co-authored-by: Bartlomiej Rutkowski <brutkowski@tilt.app>
Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
Co-authored-by: Alex Messer <dmzt08@gmail.com>
2022-12-03 21:05:24 +05:00
Michael Wolz
53fad8f235
fix: disable transactionSupport option for CordovaDriver (#9391)
* fix: disable transaction support for cordova driver

the cordova-sqlite-storage plugin does not support transactions. fc4133c
introduced an exception when starting a transactions but did not disable
the transactionSupport in general leading to errors when using the
`save` and `remove` method of the `EntityPersistExecutor`. With this PR
the `EntityPersistExecutor` will respect the drivers `transactionSupport`
option.

* docs: add note on transaction limitations for cordova driver
2022-12-03 20:54:23 +05:00
Dan Manastireanu
2473ff0a8e
feat: add parseInt8 option to postgres driver. Closes #9341 (#9435)
* feat: add parseInt8 option to postgres driver

* chore: formatting
2022-12-03 20:28:43 +05:00
kz-d
6e9151323a
docs: update "migrate:show error code" description (#9476) 2022-12-03 19:41:23 +05:00
Charlély Delgrange
3b64b1a2e0
docs: Improve comprehension of update repository API (#9417)
* Improve comprehension of update repository API

Because the previous doc example was `await repository.update({ firstName: "Timber" }, { firstName: "Rizzrak" })`, I got confused and reversed the **WHERE** condition and the actual **change**.

This change is just a suggestion to avoid that kind of confusion

* Apply the same doc suggestion change to the entity manager update API
2022-12-03 19:33:19 +05:00
Gonzalo Rodulfo Martínez
1cb738a701
feat: index support for materialized views of PostgreSQL (#9414)
* feat: Added new indices attribute to View

* feat: Added view indices methods

Such as dropViewIndex, addViewIndices, addViewIndex

Added "View" type in some parameters of methods

* feat: Added view indices support when creating new indices and dropping old indices

* ref: Renamed "table" to "view" in log when dropping view index

* feat: changed order of schema sync operations

To create a new view index, a view has to be created first.

* feat: removed unreachable code

A view object don't have its indices when creation. The indices are added to the view through the createViewIndex method.

* feat: Added view when returning TableIndex

* feat: Added view paths as argument in getViews on log method

* feat: Created createViewIndexSql

This method reuses code from createIndexSql, but eliminates the isSpatial part, because a viewColumn doesn't support this attribute.

* fix: Added missing columns const to createViewIndexSql

* feat: Removed isSpatial attribute when returning TableIndex

* feat: Added unit tests

* fix: Dropped current index to leave unique index on indices array

There was a bug that when asserting the unique index, it would compare with the previous index, even when explicitly selecting the unique index in the indices array.

* ref: lint files

* feat: added "postgres" in enabledDrivers attribute

This is to enable only PostgreSQL for the tests

* feat: added doc for materialized view indices

* ref: lint files

* feat: Added new method to create mat. view indices

This new method goes after creating the views. Aditionally, the views are now created at the end (as it was before)

* ref: prettify files

* feat: revamped tests

Replaced previous unit tests with more significant ones
2022-12-03 19:25:50 +05:00
Charlton Austin
d71e9c4394
docs: add in an example for 4526 (#9538)
* docs: add in an example for 4526

* small fixes

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
2022-12-03 17:31:32 +05:00
Bikram Suwal
975a953995
docs: general grammer (#9574) 2022-12-03 16:54:29 +05:00
smile1sky
f606a22999
docs: improve zh docs (#9575) 2022-12-03 16:53:21 +05:00
lucas
5253c8f5a6
docs: add examples in soft delete doc (#9402) 2022-11-04 16:27:13 +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
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
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
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
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
Hannes Van De Vreken
6bc723bba9
refactor: docblock (#9384) 2022-09-19 18:01:02 +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
Umed Khudoiberdiev
7198a7a732
Revert "feat: add array parameter on groupBy (#9243)" (#9320)
This reverts commit 77866d85d20991930f55000cd5d4e340c68930b4.
2022-08-24 22:49:15 +05:00
BitDesert
51a0ebe5f2
feat: new mssql option appName (#9213) 2022-08-24 21:56:51 +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
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
Bogdan Crisan
64674e60a2
docs: fix wrong function used in entity documentation (#9280)
Previously, the documentation said that it's using the `findOne`
function, but it used the `findBy` and `findOneBy` functions. In order
to be coherent, this commit changes all those to `findOneBy`.
2022-08-24 20:15:35 +05:00
Leyla Jähnig
3a533a4223
docs: migration replace Connection with DataSource option (#9315)
* docs: migration replace Connection with DataSource option

* Apply suggestions from code review

Co-authored-by: Leyla Jähnig <leyla.jaehnig@gmx.de>

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
2022-08-24 17:06:04 +05:00
Han Moe Htet
0b542225cc
docs: fix method example in EntityManager API (#9170)
Replace manager.getCustomRepository(UserRepository) with manager.withRepository(UserRepository)
2022-07-05 17:06:57 +05:00
Mohamed Akram
2e671386f4
docs: correct useUTC default value (#9161)
Closes: #7047
2022-06-30 15:38:58 +05:00
Julian Pömp
bcdddc32bd
feat: add nativeBinding option to better-sqlite3 driver (#9157)
* feat: add nativeBinding option to better-sqlite3 driver

better-sqlite3 allows to set the `nativeBinding` option since version v7.5.0. It allows to define a custom path for the native api binary `better_sqlite3.node`. This feature is very important for developers who want to create binaries of their node apps for different platforms (e.g. with pkg). [More information](https://github.com/WiseLibs/better-sqlite3/blob/master/docs/api.md#new-databasepath-options=).

* docs: add description about nativeBinding option for better-sqlite3 driver

* refactor: apply prettier, test if nativeBinding is correctly set to better-sqlite3 driver

* refactor: apply prettier

* refactor: replaced describe.only() with describe()
2022-06-29 18:54:17 +05:00
gmmkmtgk
60a79605a7
docs: repository replaced by dataSource.manager.getTreeRepository(Category) (#9144)
Repository should be replaced by dataSource.manager.getTreeRepository(Category)
2022-06-28 17:31:28 +05:00
gmmkmtgk
1b5aa62bed
docs: fix typo in tree docs
At line 167 it should be const a1 = new Category() insted of const a1 = new Category("a1") 
Category do not accept any arguments
2022-06-28 17:29:59 +05:00
Ude Samuel
07f453773c
docs: fixed full path requirement in migration:create command (#9115)
* fixed full path requirement in migration:create command

* Update migrations.md

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
2022-06-22 17:55:37 +05:00
apeltop
0659ec3952
docs: correct typos (#9047) 2022-05-30 15:26:09 +05:00
元路
1b4cb00ea2
docs: minor fix in index.md (#9025) 2022-05-23 11:40:32 +05:00
Yusuf Ganiyu
ea176b27d4
docs: update migrations.md (#9022) 2022-05-20 16:14:42 +05:00
Gary Lee
d0ed02d9ce
docs: edit mistypes in the Repository API document (#9012)
docs: edit mistypes in the Repository API document

- Edited mistypes in the example code in findAndCountBy and findOneBy method.
2022-05-20 15:42:16 +05:00
AlexMesser
78df84c732
feat: allow explicitly named primary keys, foreign keys, and indices (#8900)
* feat: add constraintName to JoinColumn

Add a constraintName to JoinColumn decorators to allow specifying foreignKey name.
Use constraintName when building JoinTable entities as well.

Partially solves: #1355

* test: add tests for constraintNames on JoinColumn

* docs: add constraintName documentation to JoinColumn and JoinTable

* test: update snapshot in 5444 test

Add constraintName property with correct variable undefined to snapshot in tests for issue 5444.

* prettier

* added support for custom FK name in Sqlite;
added test;

* removed .only

* fixed FK constraint renaming on table/column rename

* minor fix

* fixed @Unique and @Index constraints renaming on table/column rename

* working on constraint name support for PK

* replaced `constraintName` with `primaryKeyConstraintName` and `foreignKeyConstraintName`

* fixed failing test

* working on constraint name support for PK

* updated docs

Co-authored-by: Matthijs Hatzmann <matthijs.hatzmann@tradecast.eu>
2022-04-29 17:48:40 +05:00
Alessandro Maruccia
8e9b273885
docs: update generate migration docs (#8896) 2022-04-15 20:25:45 +05:00
AlexMesser
62518ae122
feat: Cloud Spanner support (#8730)
* working on Cloud Spanner driver implementation

* working on DDL synchronization

* working on DDL synchronization

* fixed failing test

* working on VIEW implementation

* fixed query parameters

* lint

* added transaction support;
added streaming support;

* fixed column types

* fixes after merge

* prettier

* added support for generated columns

* added escaping for distinct alias

* working on generated columns

* changed failing test

* updated tests for Spanner;
bugfixes;

* updated tests for Spanner;
bugfixes;

* updated tests for Spanner;
bugfixes;

* fixed failing test

* fixed failing test

* fixing failing tests

* fixing failing tests

* fixing failing tests

* added support for typeorm-generated uuid;
fixed caching;

* fixing failing tests

* fixing failing tests

* fixing failing tests

* fixing failing tests

* fixing failing tests

* fixing failing tests

* debugging failing test

* debugging failing test

* fixed bug in @PrimaryColumn decorator

* fixed failing tests

* fixed VIEW functionality;
fixed failing tests;

* updated docs
2022-04-12 17:31:57 +05:00