Skip to content

docs(query): document the join alias default and population stddev - #2074

Merged
abnegate merged 2 commits into
mainfrom
fix/join-alias-optional
Oct 17, 2026
Merged

abnegate merged 2 commits into
mainfrom
fix/join-alias-optional

Conversation

@abnegate

Copy link
Copy Markdown
Member

What

  • Join docs: the join docblocks (web, react-native, dart, php, kotlin, android) say that without an alias the join is named after the table ID.
  • Tests: each SDK's query tests (node, php, python, go, dart, kotlin, swift) pin the alias-less ON-list join and cross join. They send no alias, and the server applies its default.
  • stddev and variance: documented as population statistics. The database library maps them to STDDEV_POP and VAR_POP on every engine.

Why

  • Server default: an alias-less join used to be rejected with Join alias is required. The database library now defaults the alias to the joined table ID when that ID is a valid alias, and otherwise returns a 400 naming the reason. (Server work is in utopia-php/query, utopia-php/database and appwrite/appwrite.)
  • No signature changes: every SDK already serialized the alias-less forms correctly. The overloaded forms ship in released SDKs (web 29.0.0, node 30.0.1, python 25.0.0), so removing them would be a breaking change.

Verification

Each SDK was generated from server-ce main specs and its query tests run locally:

SDK Result
node 92/92 (jest), format:check + lint clean
php Join tests 8/8, pint clean
python pass, black clean
go pass, gofmt clean
dart 91 pass
kotlin 29/29, ktlint 1.8.0 clean
swift join tests 7/7 (swift test; CI only builds swift)

Before/after: these tests also pass on main, because the SDKs never had the bug. The fail-before proof is at the server layer: the database library's unit and e2e tests, plus the appwrite API E2E. The new SDK tests pin the wire contract that the server default relies on.

🤖 Generated with Claude Code

The server now names an alias-less join after its table ID, so every
SDK's alias-less join forms (column form, ON-list form, crossJoin) are
first-class rather than rejected. The join docblocks say so, and each
SDK's query tests pin that those forms send no alias and leave the
default to the server.

stddev and variance map to STDDEV_POP and VAR_POP on every engine, so
their docblocks now say population instead of leaving it ambiguous.

The deno templates are left alone: deno is no longer a generator target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hansi-codes

hansi-codes Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

This pull request updates generated query documentation to describe alias-less joins and identify stddev and variance as population statistics. It also adds serialization tests across the SDKs for alias-less nested-ON and cross joins.

Latest changes: The newest commits clarify that an alias-less join defaults to the table ID only when that ID is a valid alias, and that the server rejects it otherwise.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 13
File Change
templates/android/library/src/main/java/io/package/Query.kt.twig Clarifies population aggregate behavior and the valid-alias condition for alias-less joins.
templates/dart/lib/query.dart.twig Documents population aggregates and the valid-alias condition for alias-less joins.
templates/dart/test/query_test.dart.twig Adds serialization coverage for alias-less nested-ON and cross joins.
templates/go/query_test.go.twig Adds serialization coverage for alias-less nested-ON and cross joins.
templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig Clarifies population aggregate behavior and the valid-alias condition for alias-less joins.
templates/kotlin/src/test/kotlin/io/appwrite/QueryTest.kt.twig Adds serialization coverage for alias-less nested-ON and cross joins.
templates/node/test/query.test.js.twig Adds serialization coverage for alias-less nested-ON and cross joins.
templates/php/src/Query.php.twig Documents population aggregates and the valid-alias condition for alias-less joins.
templates/php/tests/QueryTest.php.twig Adds serialization coverage for alias-less nested-ON and cross joins.
templates/python/test/test_query.py.twig Adds serialization coverage for alias-less nested-ON and cross joins.
templates/react-native/src/query.ts.twig Documents the valid-alias condition for alias-less joins.
templates/swift/Tests/Tests.swift.twig Adds serialization coverage for alias-less nested-ON and cross joins.
templates/web/src/query.ts.twig Clarifies population aggregate behavior and the valid-alias condition for alias-less joins.

Reviewed the commits since f99c4c2 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Tier A · Looks good to merge. Summary

Comment thread templates/web/src/query.ts.twig Outdated
A table ID that is not a valid alias is rejected rather than defaulted,
so the docs no longer read as an unconditional default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@abnegate
abnegate merged commit c5e6b5c into main Oct 17, 2026
139 of 141 checks passed
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.

1 participant