feat: SDK update for version 20.2.0#307
Conversation
Greptile SummaryThis PR bumps the CLI SDK to version 20.2.0, adding
Confidence Score: 3/5Two defects in the changed service commands need to be fixed before merging. The
Important Files Changed
Reviews (12): Last reviewed commit: "chore: update Command Line SDK to 20.2.0" | Re-trigger Greptile |
| ```bash | ||
| appwrite databases update-big-int-attribute \ | ||
| --database-id <DATABASE_ID> \ | ||
| --collection-id <COLLECTION_ID> \ | ||
| --key '' \ | ||
| --required false \ | ||
| --default null | ||
| ``` |
There was a problem hiding this comment.
Option name mismatch in documentation example
The example uses --default null, but the actual CLI option defined in lib/commands/services/databases.ts is --xdefault. Running this example as written will produce an unknown option error. The flag should be --xdefault null — though even that won't work as written because parseInteger is used as the parser for --xdefault, so "null" would be coerced to NaN, not a JSON null. The same mismatch is present in docs/examples/tablesdb/update-big-int-column.md.
| .option(`--min <min>`, `Minimum value`, parseInteger) | ||
| .option(`--max <max>`, `Maximum value`, parseInteger) | ||
| .option(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`, parseInteger) |
There was a problem hiding this comment.
parseInteger loses precision for large BigInt values
parseInt() returns a JavaScript number (IEEE 754 double), which can only safely represent integers up to Number.MAX_SAFE_INTEGER (2^53 − 1 ≈ 9 × 10^15). Database BIGINT columns are 64-bit and accept values up to ~9.2 × 10^18. Passing a value like 9223372036854775807 through parseInteger silently serialises as 9223372036854776000 — a different number — without any error. The --min, --max, and --xdefault options all share this flaw on both the create-big-int-attribute and update-big-int-attribute commands. The same problem exists in the parallel tables-db.ts commands. A parseBigInt helper that validates as a BigInt string and passes the value as a string (or BigInt) to the SDK would fix this.
| * Added: Introduced `bigint` create/update APIs for legacy Databases attributes | ||
| * Added: Introduced `bigint` create/update APIs for `TablesDB` columns | ||
| * Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret` | ||
|
|
There was a problem hiding this comment.
CHANGELOG version doesn't match the code version
The new CHANGELOG entry is titled ## 20.2.0, but every other file in this PR (lib/constants.ts, package.json, package-lock.json, install.sh, install.ps1, scoop/appwrite.config.json) sets the version to 20.3.0. The PR title itself also says "version 20.2.0". All install scripts and release artifact URLs point to 20.3.0, so users running the install script will download a binary that was never released under the CHANGELOG's stated version, causing installation failures or confusion about which changelog entry describes the installed build.
| .requiredOption(`--installation-id <installation-id>`, `Installation Id`) | ||
| .requiredOption(`--provider-repository-id <provider-repository-id>`, `Repository Id`) | ||
| .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`) | ||
| .option(`--queries <queries>`, `Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/queries). Only supported methods are limit, offset, cursorAfter, and cursorBefore`) |
There was a problem hiding this comment.
The
--queries option is defined with <queries> (single required string) instead of [queries...] (optional variadic array). Every other command in the codebase that exposes --queries uses the variadic form so that callers can pass multiple query strings and Commander collects them into an array. With <queries>, a user can only pass a single raw string and the SDK receives a string where it expects string[], which will likely produce an API call with a malformed queries parameter.
| .option(`--queries <queries>`, `Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/queries). Only supported methods are limit, offset, cursorAfter, and cursorBefore`) | |
| .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/queries). Only supported methods are limit, offset, cursorAfter, and cursorBefore`) |
This PR contains updates to the SDK for version 20.2.0.
Whats Changed
bigintcreate/update APIs for legacy Databases attributesbigintcreate/update APIs forTablesDBcolumnskey,resourceType,resourceId, andsecret