Skip to content

fix(databases): declare every column model on getColumn and getAttribute - #13877

Merged
ChiragAgg5k merged 2 commits into
mainfrom
fix/get-column-response-models
Sep 24, 2026
Merged

ChiragAgg5k merged 2 commits into
mainfrom
fix/get-column-response-models

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

What does this PR do?

tablesDB.getColumn and databases.getAttribute return whichever model matches the stored type, but they declare only the ten pre-1.8 models (boolean, integer, float, email, enum, url, ip, datetime, relationship, string). The SDKs dispatch on the declared models, so every typed SDK (Go, Dart, Kotlin, Swift, .NET, Python, Ruby, PHP) fails to decode a varchar, text, mediumtext, longtext, bigint, point, linestring or polygon column.

Reproduced on Cloud with CLI 27.3.0 against a varchar column:

$ appwrite tablesdb get-column --database-id db --table-id posts --key secret
✗ Error: unable to match response to any expected response model

The response itself was correct ("type": "varchar", "encrypt": true); only the decoding failed.

Both routes now declare the same models as ColumnList / AttributeList, in the same order (BigInt before Integer, String last).

Test Plan

  • New tests/unit/Platform/Modules/Databases/Http/GetResponseModelsTest.php asserts that each route declares exactly the models its list route can return. It fails on main and passes here.
  • Rendered this route's response schema with the branch's OpenAPI3::getUnion(), put it into the latest server spec and generated the Go SDK with appwrite/sdk-generator. TablesDB.GetColumn now has all 18 branches, with the email/enum/url/ip branches checked before the plain string branch.
  • composer lint and composer analyze pass on the changed files.

Related PRs and Issues

  • SDKs pick this up on the next spec regeneration; no sdk-generator change is needed.

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

The single-item routes return the model matching the stored type, but the
SDKs dispatch on the models the route declares. The declaration stopped at
the pre-1.8 types, so every typed SDK failed to decode a varchar, text,
mediumtext, longtext, bigint or spatial column with "unable to match
response to any expected response model".
@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no outstanding finding or new actionable issue remains.

Summary

The PR adds the missing response models to getAttribute and getColumn so generated SDKs can recognize newer attribute and column types. Since the previous review, it also removes the implementation-coupled unit test and inaccurate ordering comments.

Reviews (2) · Last reviewed commit: "refactor(databases): drop the ordering c..."

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix/get-column-response-models (after).

Metric Before After Change
🚀 Requests/sec 184.36 197.68 🟢 +7.2%
⏱️ Latency P50 93.25 ms 88.96 ms ⚪ -4.6%
⏱️ Latency P95 216.66 ms 203.29 ms 🟢 -6.2%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 88.96 203.29 12,540 197.68 -13.36
Account 163.63 309.27 660 11.06 -32.48
TablesDB 86.7 166.68 6,820 110.33 -10.38
Storage 80.93 176.36 3,300 54.84 -8.88
Functions 124.17 237.82 1,760 29.97 -25.99

Top API waits (after)

API request Max wait (ms)
account.name.update 411.03
storage.files.create 409.97
functions.create 385.76
account.prefs.update 367.85
tablesdb.rows.get 360.15

@ChiragAgg5k
ChiragAgg5k merged commit bf53df4 into main Sep 24, 2026
50 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.

2 participants