804 Commits

Author SHA1 Message Date
Kobe Kwanten
15de46fd5d
revert "feat: nullable embedded entities (#10289)" (#10614)
This reverts commit e67d7041387df78c69599c1d3c880389a935ffbf.
2024-01-08 22:20:36 +05:00
zhennann
b5ec0889f7
docs: update Chinese faq.md (#10593) 2024-01-03 09:52:50 +05:00
Deep khurana
a00b1df68f
feat: implement OR operator (#10086)
* feat: implement or operator

This new feature enables typeorm to allow use multiple operators joining with or

Closes: #10054

* feat: implement or operator

Completed code formating using command.

Closes: #10054

* feat: implement or operator

Completed the documentation update.

Closes: #10054

* feat: implement or operator

Renamed Or operator file name.

Closes: #10054

* feat: implement or operator

Renamed Or operator file name.

Closes: #10054

* feat: implement or operator

Renamed Or operator file name.

Closes: #10054

* feat: implement or operator

Renamed Or operator.

Closes: #10054
2024-01-02 15:01:01 +05:00
seungwonleee
4329996086
docs: update Soft-Delete, Restore-Soft-Delete examples (#10585)
The getRepository method is missing from the example.
Delete the "users" written in the createQueryBuilder method because it is not used in the where method.
2024-01-02 14:26:19 +05:00
Davis Sylvester
7ecc8f3536
docs: updated id to _id (#10584) 2024-01-02 14:26:03 +05:00
Andrea Mouraud
e67d704138
feat: nullable embedded entities (#10289)
* feat: nullable embedded entities

* fix: ignore embedded columns if not selected

* test: update tests with changed behaviour

* test: replace integer with varchar for cockroachdb

* docs: add documentation

* fix: nested embedded entities

* test: update nested embedded entities behaviour
2024-01-02 12:29:41 +05:00
Minh Nguyên
5c28154cbe
feat: BeforeQuery and AfterQuery events (#10234)
* feat: add query events

Co-authored-by: mnguyen081002 <3langn@gmail.com>
Co-authored-by: andrewda <andrew@dassonville.dev>

* fix: functional cache

* test: added test for issue-3302

* refactor: use broadcasterResult.wait()

* test: use sandbox to restoring

* test: fix test from #3302 with cockroachdb

* docs: add beforeQuery and afterQuery documents

---------

Co-authored-by: andrewda <andrew@dassonville.dev>
Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
2024-01-02 12:23:25 +05:00
le-harivansh
0f11739351
docs: fix typos (#10243) 2024-01-02 12:06:14 +05:00
Tait Clarridge
3cda7ec39d
feat: add isolated where statements (#10213)
- Add `isolateWhereStatements` to the `BaseDataSourceOptions` object
  and automatically isolate where statements in the query builder
  if it is true
2024-01-02 11:54:43 +05:00
thisnamewasnottaken
122b683840
fix: mssql datasource testonborrow not affecting anything (#10589)
* Remove outdated pool.testOnBorrow references.

* Remove invalid testonborrow option. factory. options are not imported or typed.
2024-01-02 11:50:24 +05:00
Harry Brundage
72b1d1b865
feat: ability to change default replication mode (#10419)
* Add a replication test suite

* Allow overriding the default destination for read queries when using replication

For many applications that want to use read slaves, data consistency isn't super important, and so all reads can be sent by default to a read slave. For some applications though, it's only select queries that can be sent to read slaves as end-users of the application expect data consistency almost everywhere. This new setting lets apps like those change the default such that query builders need to opt *in* to sending to a read slave, instead of opt out.
2023-12-29 19:06:58 +05:00
Nemanja Stanic
b6b46fb133
feat: add exists and exists by (#10291)
This PR deprecates `exist` in favor of `exists` and `existsBy`.
2023-12-29 16:29:02 +05:00
Christopher Kiessling
6d5b5d9ba6
docs: update the docs to keep in line with the example (#10387) 2023-12-29 16:13:43 +05:00
Alperen Serkan Aksöz
7a58bbf4ea
docs: typo fixed in the manager.findAndCountBy documentation (#10396) 2023-12-29 15:56:32 +05:00
Samuel Lukes
f4e6eaf155
feat: add concurrent indexes for postgres (#10442) 2023-12-29 15:52:49 +05:00
YoungKi Lyu
95a7337143
docs: fix orderBy of Spatial columns (#10568) 2023-12-29 15:47:07 +05:00
Steve Foster
d76b546929
docs: update redis cache client options (#10521)
Between v3 and v4 in node-redis the client options changed for a collection of socket related
paramaters. In the caching documentation the v3 format for used for `host` and `socket`. When
following the documented example the redis client would default to `localhost` even when a
different value for `host` was specified.

Closes: #9987
2023-12-29 15:03:02 +05:00
seungwonleee
4173e51dd8
docs: update delete-query-builder.md (#10519)
For previous examples typescript error occurs in createQueryBuilder that says “Argument of type 'string' is not assignable to parameter of type 'QueryRunner'.ts(2345)”.
If you check the type of createQueryBuilder, the string cannot come as the first argument.
The types of createQueryBuilder are as follows.
myDataSource.createQueryBuilder<ObjectLiteral>(entityClass: EntityTarget<ObjectLiteral>, alias: string, queryRunner?: QueryRunner | undefined):
2023-12-29 14:52:03 +05:00
Gabriel Kim
b240d87f34
feat: custom STI discriminator value for EntitySchema (#10508)
add discriminator value metadata to EntitySchema

Closes: #10494
2023-12-29 14:43:59 +05:00
seungwonleee
c8ec5429eb
docs: update select-query-builder.md (#10520)
To use alias as the first argument in the createQueryBuilder method, the entity must be imported into the getRepository method to be used.
2023-12-29 13:11:16 +05:00
Corey Shupe
ebd61d1440
feat: expose countDocuments in mongodb (#10314) 2023-09-30 15:09:58 +05:00
Akshay Barad
b8af97a31d
docs: update example-with-express.md (#10374) 2023-09-30 14:48:08 +05:00
Erik McKelvey
8d0e7f98c3
docs: fix naming consistency (#10383) 2023-09-30 14:44:38 +05:00
Mohammad Rayyan
35a3a7f049
docs: added missing import in select-query-builder.md (#10385)
The example for the deleteAt was missing from the import in example of soft delete
2023-09-30 14:44:06 +05:00
Mohammad Rayyan
6378b21119
docs: update select-query-builder.md (#10297)
In the line 315 there was a mistake due to which the technical sense of the sentence was lost. I corrected the typo.
2023-09-02 14:49:44 +05:00
Raphael Pinto
e72a9da30e
docs: add the some options on Oracle documentation (#10182)
This commit adds the options serviceName and sid on
data-source-options documentation.

Related to #10181
2023-08-19 17:29:17 +05:00
richardvinc
e36aa6ccc3
docs: typo on given example (#10166)
fix typo on given example. it should log `entity`, instead of `post`
2023-08-19 17:27:17 +05:00
Murali
8740adbe9e
docs: update usage of query runner with query builder (#10093)
Co-authored-by: Murali <murali.kambhampati@agxworld.com>
2023-08-19 17:20:37 +05:00
Cody Tseng
ff6e8751d9
docs: change implements to extends (#10219) 2023-07-22 12:52:43 +05:00
AlexMesser
607d6f9595
fix: added transaction retry logic in cockroachdb (#10032)
* added transaction retry logic in cockroachdb

* added option to control max transaction retries;
added delay before transaction retry;
updated docs;

* fixes in retry logic

* enable storing queries after retrying transaction
2023-05-09 23:46:07 +05:00
Joe Rybarczyk
03058055df
fix: add trustServerCertificate option to SqlServerConnectionOptions (#9985)
* fix: add missing 'trustServerCertificate' option to SqlServerConnectionOptions interface

Closes: #8093

* docs: add `trustServerCertificate` description to mssql data source options docs

* fix: consistency between jsdoc and docs

---------

Co-authored-by: jrybarczyk <jrybarczyk@exclusiveresorts.com>
2023-05-09 15:31:27 +05:00
smith-xyz
d8a2e3730f
feat: mariadb uuid inet4 inet6 column data type support (#9845)
* feat: mariadb inet4, inet6, uuid data type support

* refactor: cleanup unnecessary methods

* style: mysqldriver formatting

* fix: handle length column metadata mariadb uuid

* fix: 8832 test suite to verify errors correctly

* style: fix 8832 test formatting

* fix: 8832 error testing cleanup

* fix: remove defaulting column type feature

* style: fix formatting

* fix: remove unnecessary dbms error test

* fix: remove unused import in test

* fix: ensure defaulting uuid generation column type
2023-04-25 11:36:20 +05:00
Jo YoHan
b06404962b
docs: update entity-manager-api.md (#9956)
typo:
const timber = await manager.findOne(User, { firstName: "Timber" })   →   const timber = await manager.findOneBy(User, { firstName: "Timber" })

Co-authored-by: Jo YoHan <37216082+oxyrinchus@users.noreply.github.com>
2023-04-18 12:07:10 +05:00
Alexis Fournier
e0165e75ee
fix: add directConnection options to MongoDB connection (#9955)
Co-authored-by: afournier <afournier@solocal.com>
2023-04-17 21:03:00 +05:00
Ezekiel Adetoro
68aa573262
docs: issue #8860 (#9951)
* fixed: issue #8860

* example looks rough

---------

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
2023-04-15 18:29:15 +05:00
mptr
f6a3ce732d
feat: support for the latest mongodb v5 (#9925)
* fix: add support for mongodb driver v5

This new fix allow support to mongodb driver v5

Closes: #7907

* refactor: remove callback from MongoDriver connect

* fix: check for propertyName in transform

* fix: add support for mongodb driver v5

This new fix allow support to mongodb driver v5

Closes: #7907

* feat: mongodb 5.2.0 typings

* fix: instanceof ObjectId check

Instanceof check now no longer references to just the
type but the loaded class ref instead.

* test: fix test name to mongodb v5

---------

Co-authored-by: Matheus Melo Antiquera <matheusantiquera@finchsolucoes.com.br>
Co-authored-by: tgrassl <grassl.timon@gmail.com>
Co-authored-by: Matheus Melo Antiquera <matheus.melo.a@hotmail.com>
2023-04-15 13:30:01 +05:00
Umed Khudoiberdiev
7dac12c2b1
fix: drop xml & yml connection option support (#9930) 2023-04-09 11:30:28 +05:00
Gabriel Kim
bc306fb5a2
feat: add support for STI on EntitySchema (#9834)
* feat: add support for STI on EntitySchema

Closes: #9833

* fix: run prettier

---------

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
2023-04-06 12:23:45 +05:00
Alexander Kraev
97280fc825
docs: update migrations docs (#9828) 2023-04-06 11:59:35 +05:00
JT Smith
98f22052be
docs: added a documentation section on debugging query builder (#9846)
* Added a section on debugging query builder

It covers using getQuery() and getQueryAndParameters() which are both useful when trying to figure out why your query isn't doing what you might expect it should do.

* forgot await

* fix typo
2023-04-05 15:55:10 +05:00
Peter Hostačný
e0e7d2c125
docs: update many-to-many-relations.md (#9861)
Fixing typescript code.
2023-04-05 15:51:10 +05:00
Ihor Levchenko
3f1142b5de
docs: update relations-faq (#9879)
Proposed a better safe-type workaround for circular dependencies.
2023-04-05 15:46:58 +05:00
JT Smith
f7b210bedb
docs: documented getCount() method (#9847)
* documented getCount()

getCount() is currently only mentioned in the documentation once, and you're never shown how to use it. This patch adds a little documentation for getCount()

* clarification
2023-04-05 15:42:30 +05:00
कारतोफ्फेलस्क्रिप्ट™
7d1f1d6958
feat: support for SQL aggregate functions SUM, AVG, MIN, and MAX to the Repository API (#9737)
* feat: Add support for SQL aggregate functions SUM, AVG, MIN, and MAX to the Repository API

* rename field name to make tests work in oracle

* fix the comments

* update the docs

* escape column name

* address PR comment

* format the code
2023-02-07 19:01:04 +05:00
Christian Forgács
12fdd73e25
refactor: use abstract logger to reduce duplicate code (#9751)
* feat(platform-tools): add more logging functions

* refactor(logger): add `AbstractLogger` to reduce duplicate code

---------

Co-authored-by: Christian Forgács <christian@wunderbit.de>
2023-02-07 17:34:37 +05:00
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