-
Notifications
You must be signed in to change notification settings - Fork 296
Update createTable code examples to include columns and indexes #2674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis 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)
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. Comment |
There was a problem hiding this 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
📒 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
createTablemethod 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
createTablemethod accepts the demonstratedcolumnsandindexesparameters 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.
There was a problem hiding this 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
Databasesbut instantiated asTablesDB. 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
📒 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
| { | ||
| key: 'idx_name_fulltext', | ||
| type: 'fulltext', | ||
| attributes: ['name'] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
What does this PR do?
Updates
createTablecode examples to demonstrate full schema creationTest Plan
Visit
/docs/products/tablesdb/tablesRelated PRs and Issues
N/A
Have you read the Contributing Guidelines on issues?
Yes
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.