24 Commits

Author SHA1 Message Date
Ahmed Radwan
65026cc509
docs: clarify adjacency list (#10664)
Closes: #2540
2025-01-05 22:16:25 +01:00
Bikram Suwal
975a953995
docs: general grammer (#9574) 2022-12-03 16:54:29 +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
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
Tiago Garcia
0c44629c83
feat: add depth limiter optional parameter when loading nested trees using TreeRepository's findTrees() and findDescendantsTree() (#7926)
Modified TreeRepository's findTrees() and findDescendantsTree() public methods to now accept an optional object with config options.
For now, said object contains a depth parameter that, if set, will limit how far down the tree those methods will crawl and retrieve nested entities.

BREAKING CHANGE: TreeRepository's protected method buildChildrenEntityTree() now requires a 4th argument. Anyone affected by this break should also review and update their implementation, otherwise this feature will not work.

Closes: #3909
2021-11-11 19:48:16 +05:00
Lukas Windisch
e4d4636391
feat: add relation options to all tree queries (#8080)
* feat: add relation options to all tree queries

Closes: #8076

* fix: corrected array index in test case

* try to fix failing test

* fix: sort the array in order to be able to apply tests
2021-11-08 19:00:39 +05:00
Shoaib Ahmed
d8f6037291
doc: improve sentence structure in tree entities section (#8142) 2021-10-02 12:50:19 -04:00
Lukas Windisch
ca26297484
feat: add relations option to tree queries (#7981)
* feat: add relation option to tree queries

Add possibility to load relations of tree entities

Closes: #7974 #4564

* style: remove unused declaration

remove unused declaration to satisfy linting.

* Update tree-entities.md

docs: rename variable for copy paste

* Update FindOptionsUtils.ts

style: remove prettified code

* style: remove prettified code

* style: remove prettified code

* test: enable test for all drivers
2021-08-04 21:24:21 +05:00
Ghassan Maslamani
ef39d12198
docs: Remove note in TreeEntity documentation about #2032 (#7777)
Removes the note which links to the closed issue https://github.com/typeorm/typeorm/issues/2032,  that is supposed to be fixed in this PR https://github.com/typeorm/typeorm/pull/7156 .
2021-06-21 10:47:45 -04:00
alexey2baranov
bcd998b4f3
feat: closure table custom naming (#7120)
* add metadata to @Tree

* add simple test

* ref column naming from string to callback(column)=>name

* fix Closure junction metadata builder

* fix ClosureSubjectExecutor columns naming

* ref ClosureSubjectExecutor columns naming

* fix ClosureEntityMetadataBuilder

* add tests

* fix test name

* doc: add closure-table custom naming docs.

* refactor: small code-style changing.

* refactor: minor refactoring during code review

Co-authored-by: alexey2baranov <Ir1n@gh>
2021-01-12 14:26:05 +05:00
Gilles Coolen
00c9f4be0e docs: fix typo (#5376) 2020-01-18 21:25:43 +05:00
Donald Hruska
04b4f3e4c9 docs: add note about inability to update/remove parent (#5179) 2019-12-05 14:19:17 +05:00
Johannes Schobel
d8907ce398 fixing typos in the EN docs 2019-03-02 12:30:13 +01:00
Johannes Schobel
2dffa6908e fix anchors and change headlines to clear markdown errors 2019-03-02 12:21:27 +01:00
Zotov Dmitry
bf92ac1d88 working on docs; 2018-04-19 15:00:36 +05:00
Umed Khudoiberdiev
8ef1695311 Merge branch 'master' into next
* master: (57 commits)
  update typescript to 2.7
  removing repeat types at postgres and sqlite
  Prevent transforms breaking on datetime types (closes #1140)
  fixing repeating column types for mysql / mariadb
  loose -> lose
  loose -> loss
  loose -> lose
  Updated the hidden column to reflect the query
  version bump
  Fix typo in connection-options.md
  Fixed typo in mongodb.md
  Update support.md
  Update support.md
  Update roadmap.md
  Update decorator-reference.md
  Update faq.md
  Update sequelize-migration.md
  Update example-with-express.md
  Update active-record-data-mapper.md
  Update using-cli.md
  ...

# Conflicts:
#	CHANGELOG.md
#	README.md
#	docs/relations.md
#	docs/roadmap.md
#	docs/tree-entities.md
#	package-lock.json
#	package.json
#	src/query-builder/UpdateQueryBuilder.ts
#	test/functional/entity-metadata-validator/basic/entity-metadata-validator.ts
#	test/functional/sqljs/auto-save.ts
2018-02-06 12:17:33 +05:00
Matt Neal
6cd62ac6cd
Grammatical Error Fixes
Fix minor English errors and added a link to an article on the benefits and understandings of Adjacency Lists.
2018-01-26 12:16:53 -05:00
Umed Khudoiberdiev
42d6c88031 added basic support for tree tables - closure tables, nested set, materialized path 2017-12-17 22:01:27 +05:00
Kaveh Fereidouni
b91175c59a
Update tree-entities.md
children should be array of categories
2017-12-07 00:30:33 -05:00
Michał Lytek
1fdeacd719
Fix tree entity sample code in docs 2017-10-30 20:03:57 +01:00
Umed Khudoiberdiev
5f9df73b0c fixes #991 2017-10-13 18:00:13 +05:00
Daniel Lang
bd9041f0f5 spelling and general improvements (part 5) 2017-10-04 13:08:40 +02:00
Umed Khudoiberdiev
b4c8e3be1e updated docs, getting ready for 0.1.0 release 2017-10-03 15:35:09 +05:00