37 Commits

Author SHA1 Message Date
Mykyta
c293bd278d
docs: fix imports in Or find operator example (#10689) 2025-01-05 22:12:27 +01:00
Mykola Kryshchuk
c27e4e83b5
docs: update find-options (#10877) 2025-01-05 21:45:28 +01:00
Alessio Napolitano
62f574bc5b
docs: add And operator example (#10603) 2024-01-26 11:00:11 +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
Taylor Hakes
68e8f22894
feat: add setOnLocked for SKIP LOCKED and NOWAIT (#9317) 2022-08-26 00:24:16 +05:00
Uros Smolnik
4687be8b77
feat: add for_key_share ("FOR KEY SHARE") lock mode for postgres driver (#8879)
Adds support for new lock mode `for_key_share` - generating FOR KEY SHARE lock. Postgres specific.

Closes: #8878
2022-04-12 17:30:52 +05:00
Umed Khudoiberdiev
9f1b8e3425
feat: new array find operators (#8766)
* added new array find operators; delegating how json and jsonb are stored directly to underlying driver (breaking)

* array: true must be explicitly defined for array json/jsonb values; strings being JSON-stringified must be manually escpaed
2022-03-21 17:48:32 +05:00
Umed Khudoiberdiev
3b8a031ece
0.3.0 (#8616)
* added find options and new option relationLoadStrategy

* find now returns null instead of undefined; removed primary relations support; bugfixing; added some changes and tests from next branch;

* added typename to connection options; added data loader types, lot of deprecations; new es2020 emit by tsc; new custom repositories syntax

* applied lint fixing

* replaced some instanceof checks

* reverting docker compose image versions

* optimizing imports

* reverting back some instanceof checks to prevent compiler errors

* downgrading es compilation version

* docs: remove "primary" from relation options (#8619)

remove ex-line 26 for being deprecated in 0.3.0:
"* `primary: boolean` - Indicates whether this relation's column will be a primary column or not."

* Revert "reverting back some instanceof checks to prevent compiler errors"

This reverts commit 7bf12a39e2297d097aa2a42989afd0e9e4f49bb0.

* Revert "optimizing imports"

This reverts commit 7588ac14e4f1bf1a82e3b7883134b9c2c8ae5f3f.

* Revert "replaced some instanceof checks"

This reverts commit bfa5a2d706f697ed1c1beb38b4455c0d33121e5a.

* fixing few comments

* removing transaction decorators

* this test is invalid - it's not clear why the hell getTreeRepository will throw an error and it's not clear what kind of error its going to throw

* addded mixed list support in connection options

* trying to fix oracle length issue

* lintfix

* removed shorten usages

* added named entity target support to the connection

* fixing entity target support in relation options via entity schema

* debugging oracle issue

* fixed issue with alias not being shortened in many to many alias cases

* some day we'll have a prettier.

* fixing oracle tests

* fixing oracle failing test

* removed "null" support in where expressions; fixed softDelete and restore incorrect usages

* renamed FindConditions to FindOptionsWhere

* version bump

* docs: update loading relation in find method (v 0.3.0) (#8621)

* docs: update relation definition method

Update the method that allows loading a specific relation inside the find method.
This method is found on the one-to-one-relations page.
Change `const users = await userRepository.find({ relations: ["profile"] });` to `const users = await userRepository.find({ relations: {profile: true});`.

* fix formatting

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>

* docs: change relations option definition (#8620)

* docs: change relations option definition

change line 139 from 
`const users = await connection.getRepository(User).find({ relations: ["profile", "photos", "videos"] });`
to
`const users = await connection.getRepository(User).find({ relations: { profile: true, photos: true, videos: true] });`
to reflect version 0.3.0 changes

* docs: change relations option definition

Rectified a type on line 139
from:
`const users = await connection.getRepository(User).find({ relations: { profile: true, photos: true, videos: true] });`
to
`const users = await connection.getRepository(User).find({ relations: { profile: true, photos: true, videos: true} });`

* formatting

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>

* lint

* improved find options types

* fixed types and removed nonnever because it causes circual issue for some reason

* docs: update entitymanager definition (#8623)

* docs: update entitymanager definition

change the "What is EntityManager?" page to be up-to-date with v 0.3.0

1. line 6 changes from
`You can access the entity manager via 'getManager()' or from 'Connection'.`
to 
`You can access the entity manager via DataSource's manager.`

2. the import on `getManager` in line 10 becomes `Manager` that the user have configured beforehand:
`import {getManager} from "typeorm";`
becomes 
`import {Manager} from "./config/DataSource";`

3.change entityManager definition in line 13:
from
`const entityManager = getManager(); // you can also get it via getConnection().manager`
to
`const entityManager = Manager;`

* docs: update entitymanager definition

changed line 10 from: 
`import {Manager} from "./config/DataSource";`
to
`import {DataSource} from "typeorm";`

and changed line 13 and 14 from: 
`const entityManager = Manager;`
`const user = await entityManager.findOne(User, 1);`
to 
`const myDataSource = new DataSource({ /*...*/ });`
`const user = await myDataSource.manager.findOne(User, 1);`

for a simpler way of describing the origin of DataSource and how it works.

* In return type doesn't seem to work in all cases

* feat: mssql v7 support (#8592)

Adds support for v7 of the mssql library as v6 is EOL. This also makes use of the new toReadableStream method on requests to return a native stream where required.

* fix: prefix relation id columns contained in embedded entities (#6977) (#7432)

* fix: prefix relation id columns contained in embedded entities (#6977)

Searches embedded entity columns for relation ID column if relation column
is in embedded entity. If not found, creates new relation ID with embedded
metadata set to match the relation column.

fixes: #2254
fixes: #3132
fixes: #3226
fixes: #6977

* test: prefix subcounters sub-entity with "sub" to fit in 30 character identifier for oracle

Problem introduced with #6981

* fix: find by Date object in sqlite driver (#7538)

* fix: find by Date object in sqlite driver

In sqlite, Date objects are persisted as UtcDatetimeString.
But a Date object parameter was escaped with .toISOString(), making such queries impossible.
This commit aligns both transforms.
This bug does *not* apply to better-sql where you can only bind numbers, strings, bigints, buffers,
and null.
This is breaking for when the user inserted their dates manually as ISO and relied on this old
maltransformation, after this their find()s by Date won't work anymore.

BREAKING CHANGE: Change Date serialization in selects
Closes: #2286

* add failing test

* fix: find by Date object in sqlite driver (with query builder)

Also consider query builder parameter escaping

* test: add test for 3426

Co-authored-by: James Ward <james@notjam.es>

* manually ported changes from #7796

* updated changelog

* fixes after merge

* new findOne syntax

* new find* syntax

* new find* syntax

* lint

* tsc version bump

* tsc version bump and fixed mongodb issues

* moved date fns into non dev deps

* returned oracledb dep into place

* removed lock files

* returned lock files back

* eslint upgrade

* fixing mongodb issue

* fixing mongodb issue

* test: keep junction aliases short (#8637)

Tests a fix for an issue where junction aliases (e.g. in many-to-many relations)
are not unique because they are too long and thus truncated by the driver.

Closes: #8627
Related to: 76cee41dcf1c146d02715c7f48fed33672d28c67

* fixing mongodb issues

* fixing sqlite test

* fixing sqlite test

* fixing sqlite test

* fixing mongodb test

* fixing entity schema tests

* fixing entity schema tests

* merged latest master

* removed driver instanceof checks

* removed function instanceof checks

* removed Object instanceof checks

* removing instanceof checks...

* fixing instanceof checks

* added InstanceChecker to remove remaining instanceof checks

* fixed failing test

* linting

* fixing failing test

* version bump

* compiler fixes

* Connection type usages replace to DataSource

* updated dev deps

* updated deps, add prettier, removed oracledb due to m1 issue

* chalk downgrade

* fixing failing test

* applied prettier formatting

* replaced eslint to prettier

* okay I think we can call it lint

* fixing linting

* fixed prettier introduced compiler bug

* fixed failing test

* prettier;

* fixed failing test

* alias shortening only for junction tables;
fixed failing tests;

* changed aurora db names and reverted change of junction table name shorten algorithm

* format

* removed platform from docker compose

* made numeric parameters to not use parameters to prevent parameters number limit issue. Also enabled shorten only for junction tables

* fixing test

* fixing returning columns bugs

* fixing test

* fixed returning issue

* fixing merge conflicts

* updating documentation

* working on docs / improving api

* working on docs

* fixed isConnected issue

* re-worked commands

* commenting cli command tests for now

* commenting cli command tests for now

* removed platform

* returned Connection back

* refactor: export tree repository helper methods (#8753)

* Migrated protected tree methods to util class

* Added tree repository extend override

* Ran prettier format

* merge master into 0.3.0

Co-authored-by: Bitcollage <serkan.sipahi@yahoo.de>

* working on documentation

Co-authored-by: Bilel Taktak <47742269+Parsath@users.noreply.github.com>
Co-authored-by: Salah Azzouz <52634440+Salah-Azzouz@users.noreply.github.com>
Co-authored-by: Daniel Hensby <dhensby@users.noreply.github.com>
Co-authored-by: Nebojša Cvetković <nebkat@gmail.com>
Co-authored-by: Philip Waritschlager <philip+github@waritschlager.de>
Co-authored-by: James Ward <james@notjam.es>
Co-authored-by: Felix Gohla <37421906+felix-gohla@users.noreply.github.com>
Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
Co-authored-by: Jimmy Chen <50786287+Q16solver@users.noreply.github.com>
Co-authored-by: Bitcollage <serkan.sipahi@yahoo.de>
2022-03-17 21:01:45 +05:00
Brian Adams
ce69228721
docs: adding undocumented behavior to findOptions doc (#8499) 2022-01-15 19:44:13 +05:00
Audwin
90a8deb638
docs: Improve various formatting code syntax and capitalisation (#8449)
* docs: Improve various docs formatting

code syntax highlight on `leftJoinAndSelect`
capitalise SQL word

* docs: capitalise SQL word on classes methods docs

* docs: lowercase SQL word to trigger auto-test

* docs: uppercase SQL word to trigger auto-test
2021-12-11 12:58:57 +05:00
Michael Schramm
d494fccc9c
feat: lock modes in cockroachdb (#8250)
closes #8249
2021-11-18 13:28:00 +05:00
Gabriel Haruki
fbbac93b5b
docs: add sql examples to basic options (#7994) 2021-08-03 12:37:17 +05:00
James Ward
3221c50d87
fix: better support of relation-based properties in where clauses (#7805) 2021-07-03 13:29:56 -05:00
James Ward
e2a5939bfb
docs: example used invalid parameter (#7819)
the example had a parameter but wrapped it in quotes for some
reason.  this removes the quotes
2021-06-30 03:12:40 -04:00
Wang Guan
8140a91de1
docs: update lock modes in find-options.md (#7518) 2021-04-01 21:14:22 +05:00
Umed Khudoiberdiev
2fa6231e59 adding missing ILike operator docs (took from next branch) 2021-02-26 01:13:20 +05:00
Oleksandr Kovpashko
a3faf49987
docs: fix invalid code block in "find many options" (#7268) 2021-01-12 12:53:21 +05:00
Adrian
a49db9612b
docs: document withDeleted option (#7132) 2021-01-11 17:57:23 +05:00
Tycho Tatitscheff
bc60dd559b
docs: improve the doc about Raw operator and add missing test (#6863)
* docs: improve raw documentation

* test: add missing test case
2020-10-07 04:11:24 -04:00
Kamil Burzynski
2c90e1c05f
feat: added support for NOWAIT & SKIP LOCKED in Postgres (#5927)
* Added support for NOWAIT & SKIP LOCKED in Postgres

* fix merge typo

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
2020-05-16 14:08:06 +03:00
Alfonso Alonso Lorenzo
b571f5dd69 added dirty read(NOLOCK) in SQLServer 2019-05-13 13:29:55 +02:00
Zotov Dmitry
996e89bd31 added lock option in FindOptions; 2019-03-25 20:42:01 +05:00
Rodolfo Silva
6d6c9b6334 Add lessThanOrEqual and moreThanOrEqual operators.
In #3126 @alfaproject asked about this two operators.
I decide to implement and send the PR with this operators.
2019-01-06 15:56:39 -03:00
Rodolfo Silva
69a752957d
Update docs to add OR operator
@pleerock mentioned on the #2929 the way how we can use the OR operator with the findOptions.
2019-01-06 10:56:51 -03:00
Umed Khudoiberdiev
145dad4426
fixed raw docs 2018-12-14 09:01:35 +05:00
Razzwan
35e74dd28b [Docs] add description of Raw Advanced option using function 2018-10-31 08:16:59 +02:00
Jose Miguel Colella
e813a252b7
Add information for MSSQL user for limit use
Added additional information in documentation for users utilizing MSSQL database and wanting to use take a certain amount of accounts.
2018-06-19 08:59:00 -04:00
droplet92
b5602d15ef Delete unnecessary double quotes 2018-06-04 12:14:11 +09:00
Oren Schwartz
ba6eaa620c
Update find-options.md 2018-05-20 21:39:32 +03:00
Zotov Dmitry
d1cde925db working on docs; 2018-04-19 14:46:43 +05:00
Zotov Dmitry
f52e2dae95 working on docs; 2018-04-19 14:04:20 +05:00
Zotov Dmitry
2931b8a39b working on docs; 2018-04-19 13:36:51 +05:00
Daniel Lang
252b79285e improved docs on webpack change and new find option 2017-12-01 23:46:07 +01:00
AJ Liptak
3661fc4b16 Adding cache to find-options docs 2017-10-23 15:07:45 -05:00
Daniel Lang
8714a84e01 docs: spelling and general improvements (part 3) 2017-10-03 21:46:55 +02:00
Umed Khudoiberdiev
ff9bfeb435 improving docs 2017-10-03 17:44:52 +05:00
Umed Khudoiberdiev
b4c8e3be1e updated docs, getting ready for 0.1.0 release 2017-10-03 15:35:09 +05:00