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-based payloads including full column and index definitions.
    • Added comprehensive sample column and index sets (types, constraints, relationships) to each language example.
    • Minor punctuation and wording refinements for better 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 pull request updates documentation examples for the createTable API across multiple Server SDKs (Node.js, Deno, PHP, Python, Ruby, Java, Kotlin, Dart, C#, Swift, and others). Each example replaces previous positional/minimal calls with a single object payload that includes databaseId, tableId, name, and expanded columns and indexes arrays defining many column types, relationships, and index definitions. A small punctuation change also adjusts a permissions note ("Learn more" capitalization and sentence punctuation).

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 'Update createTable code examples to include columns and indexes' clearly and specifically describes the main change: updating documentation examples to show full schema creation with columns and indexes.
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.

Comment on lines +790 to +810
},
{
'key': 'path',
'type': 'line',
'required': false
},
{
'key': 'area',
'type': 'polygon',
'required': false
},
{
'key': 'related_items',
'type': 'relationship',
'relatedTableId': '<RELATED_TABLE_ID>',
'relationType': 'manyToMany',
'twoWay': true,
'twoWayKey': 'items',
'onDelete': 'cascade',
'required': false
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Fix indentation inconsistency in Dart example.

Lines 790-810 have excessive indentation compared to the preceding lines in the same columns array (lines 738-789). This formatting inconsistency reduces readability.

🔎 Proposed fix for consistent indentation
       {
         'key': 'location',
         'type': 'point',
         'required': false
-            },
-            {
-                'key': 'path',
-                'type': 'line',
-                'required': false
-            },
-            {
-                'key': 'area',
-                'type': 'polygon',
-                'required': false
-            },
-            {
-                'key': 'related_items',
-                'type': 'relationship',
-                'relatedTableId': '<RELATED_TABLE_ID>',
-                'relationType': 'manyToMany',
-                'twoWay': true,
-                'twoWayKey': 'items',
-                'onDelete': 'cascade',
-                'required': false
+      },
+      {
+        'key': 'path',
+        'type': 'line',
+        'required': false
+      },
+      {
+        'key': 'area',
+        'type': 'polygon',
+        'required': false
+      },
+      {
+        'key': 'related_items',
+        'type': 'relationship',
+        'relatedTableId': '<RELATED_TABLE_ID>',
+        'relationType': 'manyToMany',
+        'twoWay': true,
+        'twoWayKey': 'items',
+        'onDelete': 'cascade',
+        'required': false
       }
📝 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
},
{
'key': 'path',
'type': 'line',
'required': false
},
{
'key': 'area',
'type': 'polygon',
'required': false
},
{
'key': 'related_items',
'type': 'relationship',
'relatedTableId': '<RELATED_TABLE_ID>',
'relationType': 'manyToMany',
'twoWay': true,
'twoWayKey': 'items',
'onDelete': 'cascade',
'required': false
}
},
{
'key': 'path',
'type': 'line',
'required': false
},
{
'key': 'area',
'type': 'polygon',
'required': false
},
{
'key': 'related_items',
'type': 'relationship',
'relatedTableId': '<RELATED_TABLE_ID>',
'relationType': 'manyToMany',
'twoWay': true,
'twoWayKey': 'items',
'onDelete': 'cascade',
'required': false
}
🤖 Prompt for AI Agents
In src/routes/docs/products/databases/tables/+page.markdoc around lines 790 to
810, the Dart example's entries in the columns array are over-indented compared
to earlier entries (lines 738-789); adjust the indentation of the objects from
lines 790–810 so they align with the preceding array items (same nesting/indent
level), ensuring consistent spacing for keys like 'key', 'type', 'required', and
the nested properties ('relatedTableId', 'relationType', etc.) to match the
style used earlier in the array.

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