Skip to content

feat: SDK update for version 20.2.0#307

Open
ArnabChatterjee20k wants to merge 12 commits intomasterfrom
dev
Open

feat: SDK update for version 20.2.0#307
ArnabChatterjee20k wants to merge 12 commits intomasterfrom
dev

Conversation

@ArnabChatterjee20k
Copy link
Copy Markdown
Member

@ArnabChatterjee20k ArnabChatterjee20k commented May 7, 2026

This PR contains updates to the SDK for version 20.2.0.

Whats Changed

  • 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

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 7, 2026

Greptile Summary

This PR bumps the CLI SDK to version 20.2.0, adding bigint attribute/column create and update commands for both Databases and TablesDB, extending variable management commands with a --variable-id parameter and pagination options, renaming update-rule-verification to update-rule-status, adding --on-duplicate to migration commands, and replacing real-looking OAuth2 secret examples with <CLIENT_SECRET> placeholders.

  • New bigint commands (databases.ts, tables-db.ts): create-big-int-attribute and update-big-int-attribute (and their TablesDB counterparts) are added. The update variants declare --xdefault as requiredOption even though the description states it cannot be set when required=true — making it impossible to update a bigint attribute to required via the CLI (previously flagged).
  • --queries type mismatch in vcs.ts: The new --queries option on list-repository-branches uses <queries> (single string) instead of [queries...] (variadic array), inconsistent with every other command in the codebase and likely causing the SDK to receive a string where an array is expected.
  • Version bump and install script updates: All version strings (constants.ts, package.json, install.sh, install.ps1, scoop/appwrite.config.json) are consistently updated to 20.2.0.

Confidence Score: 3/5

Two defects in the changed service commands need to be fixed before merging.

The vcs.ts list-repository-branches command passes a single string to the SDK where an array is expected, silently breaking any caller that supplies query strings. The update-big-int-attribute and update-big-int-column commands force users to supply --xdefault even when setting required=true, an API-rejected combination that makes required bigint updates impossible via the CLI.

lib/commands/services/vcs.ts (queries option type) and lib/commands/services/databases.ts / lib/commands/services/tables-db.ts (xdefault required-option on update commands)

Important Files Changed

Filename Overview
lib/commands/services/vcs.ts Adds --search and --queries options to list-repository-branches; --queries incorrectly uses <queries> (single string) instead of [queries...] (array), breaking multi-query usage
lib/commands/services/databases.ts Adds create-big-int-attribute and update-big-int-attribute commands; --xdefault on the update command is incorrectly declared as requiredOption despite being incompatible with required=true attributes
lib/commands/services/tables-db.ts Adds create-big-int-column and update-big-int-column commands; same --xdefault required-option bug as the databases counterpart
lib/commands/services/functions.ts Adds pagination/filter options to list-variables, adds --variable-id to create-variable, and makes --key optional on update-variable
lib/commands/services/sites.ts Mirrors the functions.ts variable changes: pagination on list-variables, --variable-id on create-variable, optional --key on update-variable
lib/commands/services/proxy.ts Renames update-rule-verification to update-rule-status, removes --search from list-rules, and adds MD5-hash note to rule-creation commands
lib/commands/services/project.ts Renames --provider to --provider-id on get-o-auth-2-provider, adds pagination to list-o-auth-2-providers, and replaces real-looking OAuth2 secret examples with <CLIENT_SECRET> placeholder across all providers
lib/commands/services/migrations.ts Adds --on-duplicate option to createAppwriteMigration, createCSVImport, and createJSONImport commands
lib/constants.ts Bumps SDK_VERSION from 20.1.0 to 20.2.0

Reviews (12): Last reviewed commit: "chore: update Command Line SDK to 20.2.0" | Re-trigger Greptile

Comment on lines +1 to +8
```bash
appwrite databases update-big-int-attribute \
--database-id <DATABASE_ID> \
--collection-id <COLLECTION_ID> \
--key '' \
--required false \
--default null
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 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.

Comment thread README.md
Comment on lines +378 to +380
.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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 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.

@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Command Line SDK update for version 20.2.0 feat: Command Line SDK update for version 20.3.0 May 8, 2026
Comment thread CHANGELOG.md
* 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`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 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.

Comment thread lib/questions.ts Outdated
@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Command Line SDK update for version 20.3.0 feat: Command Line SDK update for version 20.2.0 May 8, 2026
Comment thread lib/commands/generic.ts Outdated
@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Command Line SDK update for version 20.2.0 feat: SDK update for version 20.2.0 May 8, 2026
.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`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 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.

Suggested change
.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`)

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