Skip to content

Add tests and docs for experimental Relations() table valued function - #9647

Open
khanaffan wants to merge 6 commits into
masterfrom
affan/relations-vtab-tests-docs
Open

Add tests and docs for experimental Relations() table valued function#9647
khanaffan wants to merge 6 commits into
masterfrom
affan/relations-vtab-tests-docs

Conversation

@khanaffan

@khanaffan khanaffan commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

imodel-native: iTwin/imodel-native#1400

Summary

Adds tests and documentation for the experimental ECVLib.Relations() ECSQL table valued function.

Tests

  • New core/backend/src/test/ecsql/queries/RelationsVTTests.ecsql.md — 18 cases in the markdown ECSQL runner covering direction, argument validation, NavPropertyName, multi-hop and recursive CTE traversal, plus BisCore examples.
  • ECSqlDatasets.ts adds one link table relationship instance (inserted last, so no existing ids shift).
  • PRAGMA ecsql_ver expectation updated 2.0.4.02.0.4.1.

Docs

  • New docs/learning/ECSqlReference/Relations.md reference page, linked from the ECSqlReference index.
  • Pointer section in ECSQL.md, refreshed ecsql_ver sample in Pragmas.md, and a NextVersion.md entry.

Adds TypeScript-side coverage and documentation for the new experimental
`ECVLib.Relations()` ECSQL table valued function introduced natively in
iTwin/imodel-native#1400.

Tests (core/backend markdown ECSQL runner):
- New RelationsVTTests.ecsql.md with 18 cases covering the experimental
  gate, traversal direction (default/forward/backward, case insensitivity,
  NULL), argument validation, NavPropertyName nullability, multi-hop
  chaining, CTE-supplied seeds and recursive traversal, plus BisCore
  oriented learning examples.
- ECSqlDatasets.ts inserts one AllProperties:TestElementRefersToElements
  link table instance so NavPropertyName IS NULL can be asserted. It is
  inserted last so no existing element or aspect ids shift.
- Misc.ecsql.md PRAGMA ecsql_ver expectation 2.0.4.0 -> 2.0.4.1.
- JoinClause.ecsql.md notes why "JOIN on Empty Table" is still valid now
  that the relationship table holds one row with an unset `i`.

Docs:
- New ECSqlReference/Relations.md reference page, linked from the
  ECSqlReference index.
- ECSQL.md gains a short pointer section.
- Pragmas.md ecsql_ver sample refreshed from the stale 2.0.3.1.
- NextVersion.md changelog entry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@khanaffan
khanaffan force-pushed the affan/relations-vtab-tests-docs branch from ae4d20d to c4fafdc Compare August 21, 2026 17:03
@mergify

mergify Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it @khanaffan? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

Comment thread core/backend/src/test/ecsql/queries/RelationsVTTests.ecsql.md Outdated
khanaffan and others added 4 commits September 9, 2026 12:26
Preserve the current master release notes and retain the experimental Relations documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Require SQL NULL for link-table navigation names, assert empty results for negative cases, join on complete instance keys, and clarify recursion and performance documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@khanaffan
khanaffan enabled auto-merge (squash) September 11, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants