Skip to content

Conversation

@adityaoberai
Copy link
Member

@adityaoberai adityaoberai commented Dec 26, 2025

What does this PR do?

Updates createTable code examples to demonstrate full schema creation

Test Plan

Visit /docs/products/tablesdb/tables

Related PRs and Issues

N/A

Have you read the Contributing Guidelines on issues?

Yes

Summary by CodeRabbit

  • Documentation
    • Updated createTable examples across all SDKs to use explicit object-style payloads that include full column and index definitions.
    • Added comprehensive sample columns and typical indexes in every language example for clearer, consistent guidance.
    • Minor punctuation and wording refinements for improved clarity.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

Walkthrough

This PR updates documentation code samples for the createTable API across Server SDK samples (Node.js, Deno, PHP, Python, Ruby, Java, Kotlin, Dart, JavaScript, C#, Swift, etc.). Each sample now passes a single object payload containing databaseId, tableId, name, and expanded columns and indexes arrays with detailed column and index definitions. A minor punctuation/capitalization change was made in one CLI/docs note.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating createTable code examples to include columns and indexes across all language bindings in the documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6410da9 and e6c5448.

📒 Files selected for processing (1)
  • src/routes/docs/products/databases/tables/+page.markdoc
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-05T19:35:04.162Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/nuxt/step-6/+page.markdoc:79-83
Timestamp: 2025-09-05T19:35:04.162Z
Learning: In Nuxt tutorial files, the correct Appwrite database instance to use is `tablesDB` (imported from "~/appwrite"), not `database`. All tablesDB method calls should use the object parameter format: listRows({ databaseId, tableId, queries }), createRow({ databaseId, tableId, rowId, data }), and deleteRow({ databaseId, tableId, rowId }).

Applied to files:

  • src/routes/docs/products/databases/tables/+page.markdoc
📚 Learning: 2025-09-05T19:35:53.943Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react/step-6/+page.markdoc:70-75
Timestamp: 2025-09-05T19:35:53.943Z
Learning: In React tutorial files, the correct Appwrite database instance to import is `tablesDB` from "../appwrite", not `databases`. The import statement should be `import { tablesDB } from "../appwrite"` to match the usage throughout the React tutorial code.

Applied to files:

  • src/routes/docs/products/databases/tables/+page.markdoc
📚 Learning: 2025-09-05T19:35:59.449Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react-native/step-6/+page.markdoc:67-73
Timestamp: 2025-09-05T19:35:59.449Z
Learning: In React Native tutorials, the lib/appwrite.js file exports `tablesDB` (not `databases`), so imports should use `import { tablesDB } from "../lib/appwrite"` to match the export pattern established in step-3.

Applied to files:

  • src/routes/docs/products/databases/tables/+page.markdoc
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: assets
🔇 Additional comments (2)
src/routes/docs/products/databases/tables/+page.markdoc (2)

1178-1178: LGTM - Clear and well-formatted documentation text.

The updated permissions note properly directs users to learn more about the createTable method in the API references.


39-1174: Documentation examples are syntactically correct and well-structured across all Server SDKs.

The expanded examples effectively demonstrate comprehensive table creation with 13 column types and 3 index types in consistent, language-appropriate syntax. No formatting issues were found in the Dart block or elsewhere.

However, verification of actual API signature compatibility with the Appwrite SDKs requires access to the SDK repositories themselves (appwrite/sdk-for-nodejs, appwrite/sdk-for-php, etc.), which are not available in this documentation website repository. The examples appear internally consistent and correct, but definitive validation that the createTable method accepts the demonstrated columns and indexes parameters with all shown column types (email, enum, relationship, etc.), relationship properties (relatedTableId, relationType, twoWay, twoWayKey, onDelete), and index types (unique, key, fulltext) cannot be performed without access to those SDK repositories.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/routes/docs/products/databases/tables/+page.markdoc (1)

725-725: Type mismatch in Dart example.

The variable is declared as Databases but instantiated as TablesDB. This should use the same type for consistency and correctness.

🔎 Proposed fix
-  Databases tablesDB = TablesDB(client);
+  TablesDB tablesDB = TablesDB(client);
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6c5448 and 629c961.

📒 Files selected for processing (1)
  • src/routes/docs/products/databases/tables/+page.markdoc
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/nuxt/step-6/+page.markdoc:79-83
Timestamp: 2025-09-05T19:35:04.162Z
Learning: In Nuxt tutorial files, the correct Appwrite database instance to use is `tablesDB` (imported from "~/appwrite"), not `database`. All tablesDB method calls should use the object parameter format: listRows({ databaseId, tableId, queries }), createRow({ databaseId, tableId, rowId, data }), and deleteRow({ databaseId, tableId, rowId }).
📚 Learning: 2025-09-05T19:35:04.162Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/nuxt/step-6/+page.markdoc:79-83
Timestamp: 2025-09-05T19:35:04.162Z
Learning: In Nuxt tutorial files, the correct Appwrite database instance to use is `tablesDB` (imported from "~/appwrite"), not `database`. All tablesDB method calls should use the object parameter format: listRows({ databaseId, tableId, queries }), createRow({ databaseId, tableId, rowId, data }), and deleteRow({ databaseId, tableId, rowId }).

Applied to files:

  • src/routes/docs/products/databases/tables/+page.markdoc
📚 Learning: 2025-09-05T19:35:59.449Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react-native/step-6/+page.markdoc:67-73
Timestamp: 2025-09-05T19:35:59.449Z
Learning: In React Native tutorials, the lib/appwrite.js file exports `tablesDB` (not `databases`), so imports should use `import { tablesDB } from "../lib/appwrite"` to match the export pattern established in step-3.

Applied to files:

  • src/routes/docs/products/databases/tables/+page.markdoc
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build
  • GitHub Check: assets
  • GitHub Check: tests
🔇 Additional comments (3)
src/routes/docs/products/databases/tables/+page.markdoc (3)

42-134: LGTM!

The Node.js example correctly demonstrates the full schema creation with columns and indexes using the object parameter format. The structure is consistent and well-formatted.


275-590: LGTM!

The PHP, Python, and Ruby examples are well-structured with correct syntax for their respective languages. The column and index definitions are comprehensive and consistent.


609-718: LGTM!

The C#, Kotlin, and Swift examples correctly demonstrate the full schema creation with appropriate language-specific constructs (Dictionary collections, mapOf/listOf, and array literals respectively).

Also applies to: 853-943, 1081-1172

Comment on lines +245 to +249
{
key: 'idx_name_fulltext',
type: 'fulltext',
attributes: ['name']
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor indentation inconsistency in Deno example.

Line 245 has an extra space of indentation compared to the other index objects (lines 235 and 240).

🔎 Proposed fix
-         {
+        {
             key: 'idx_name_fulltext',
             type: 'fulltext',
             attributes: ['name']
-        }
+         }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/routes/docs/products/databases/tables/+page.markdoc around lines 245 to
249 there is an indentation inconsistency: the opening brace for the
idx_name_fulltext index object is indented one extra space compared to the other
index objects; fix it by adjusting the leading whitespace so the object aligns
with the other index entries (match the same indentation level as the objects at
lines ~235 and ~240).

.setProject("<PROJECT_ID>") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

Databases tablesDB = new TablesDB(client);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Type mismatch in Java example.

The variable is declared as Databases but instantiated as TablesDB. This should use consistent types.

🔎 Proposed fix
-Databases tablesDB = new TablesDB(client);
+TablesDB tablesDB = new TablesDB(client);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Databases tablesDB = new TablesDB(client);
TablesDB tablesDB = new TablesDB(client);
🤖 Prompt for AI Agents
In src/routes/docs/products/databases/tables/+page.markdoc around line 957, the
Java example declares the variable as type `Databases` but instantiates it with
`new TablesDB(client)`, causing a type mismatch; change the declaration to the
correct type (`TablesDB`) to match the instantiated class (or alternatively
instantiate `new Databases(...)` if `Databases` was intended) so the variable
type and the constructor align.

@adityaoberai adityaoberai merged commit 3cd35e0 into main Dec 30, 2025
6 checks passed
@adityaoberai adityaoberai deleted the add-full-schema-creation-docs branch December 30, 2025 19:03
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.

3 participants