Skip to content

Conversation

abnegate
Copy link
Member

@abnegate abnegate commented Oct 9, 2025

This PR contains updates to the React Native SDK for version 0.17.0.

Summary by CodeRabbit

  • New Features

    • Added transaction support across Databases and TablesDB, including creating, listing, fetching, updating (commit/rollback), deleting transactions, and batch operations.
    • All major CRUD and attribute operations now accept an optional transactionId for transactional reads/writes.
  • Documentation

    • New examples for transaction lifecycle and batch operations.
    • Updated existing Databases and TablesDB examples to include transactionId in CRUD and list calls.
  • Chores

    • Version bumped to 0.17.0 with corresponding changelog and SDK header updates.

Copy link

coderabbitai bot commented Oct 9, 2025

Walkthrough

Version updated to 0.17.0 with a changelog entry. Client header x-sdk-version bumped accordingly. New Models types added: Transaction and TransactionList. Databases and TablesDB services now include transaction management methods: listTransactions, createTransaction, getTransaction, updateTransaction, deleteTransaction, and createOperations. Many existing document/row methods were extended with an optional transactionId parameter, including list/get/create/upsert/update/delete and increment/decrement attribute/column operations. Documentation examples were added or updated across Databases and TablesDB to demonstrate transaction creation, listing, retrieval, update, deletion, createOperations, and passing transactionId in API calls.

Suggested reviewers

  • ChiragAgg5k

Pre-merge checks and finishing touches

✅ 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 is concise and clearly indicates a feature release for version 0.17.0 of the React Native SDK, which aligns with the version bump present in the changeset. While it does not explicitly mention the new transaction support added for Databases and TablesDB, it remains a valid summary of the overall version update. It is specific enough for a teammate to recognize this as the release for version 0.17.0.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

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

@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: 4

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90948c5 and ede50ff.

📒 Files selected for processing (34)
  • CHANGELOG.md (1 hunks)
  • docs/examples/databases/create-document.md (1 hunks)
  • docs/examples/databases/create-operations.md (1 hunks)
  • docs/examples/databases/create-transaction.md (1 hunks)
  • docs/examples/databases/decrement-document-attribute.md (1 hunks)
  • docs/examples/databases/delete-document.md (1 hunks)
  • docs/examples/databases/delete-transaction.md (1 hunks)
  • docs/examples/databases/get-document.md (1 hunks)
  • docs/examples/databases/get-transaction.md (1 hunks)
  • docs/examples/databases/increment-document-attribute.md (1 hunks)
  • docs/examples/databases/list-documents.md (1 hunks)
  • docs/examples/databases/list-transactions.md (1 hunks)
  • docs/examples/databases/update-document.md (1 hunks)
  • docs/examples/databases/update-transaction.md (1 hunks)
  • docs/examples/databases/upsert-document.md (1 hunks)
  • docs/examples/tablesdb/create-operations.md (1 hunks)
  • docs/examples/tablesdb/create-row.md (1 hunks)
  • docs/examples/tablesdb/create-transaction.md (1 hunks)
  • docs/examples/tablesdb/decrement-row-column.md (1 hunks)
  • docs/examples/tablesdb/delete-row.md (1 hunks)
  • docs/examples/tablesdb/delete-transaction.md (1 hunks)
  • docs/examples/tablesdb/get-row.md (1 hunks)
  • docs/examples/tablesdb/get-transaction.md (1 hunks)
  • docs/examples/tablesdb/increment-row-column.md (1 hunks)
  • docs/examples/tablesdb/list-rows.md (1 hunks)
  • docs/examples/tablesdb/list-transactions.md (1 hunks)
  • docs/examples/tablesdb/update-row.md (1 hunks)
  • docs/examples/tablesdb/update-transaction.md (1 hunks)
  • docs/examples/tablesdb/upsert-row.md (1 hunks)
  • package.json (1 hunks)
  • src/client.ts (1 hunks)
  • src/models.ts (2 hunks)
  • src/services/databases.ts (26 hunks)
  • src/services/tables-db.ts (26 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/services/tables-db.ts (1)
src/models.ts (5)
  • TransactionList (221-230)
  • Transaction (1258-1283)
  • Row (235-264)
  • DefaultRow (266-269)
  • RowList (11-20)
src/services/databases.ts (1)
src/models.ts (5)
  • TransactionList (221-230)
  • Transaction (1258-1283)
  • Document (274-303)
  • DefaultDocument (305-308)
  • DocumentList (25-34)
🔇 Additional comments (10)
docs/examples/databases/update-document.md (1)

15-15: Fix invalid permission string literal

The example currently uses permissions: ["read("any")"], which is not valid JavaScript/TypeScript syntax and will break when copied. Switching the inner quotes fixes it.

-    permissions: ["read("any")"], // optional
+    permissions: ['read("any")'], // optional

Likely an incorrect or invalid review comment.

docs/examples/databases/update-transaction.md (1)

1-15: LGTM!

The example clearly demonstrates the updateTransaction API usage with proper client configuration and optional parameters.

docs/examples/databases/get-document.md (1)

13-14: LGTM!

The addition of transactionId as an optional parameter aligns with the transaction support introduced in this release.

docs/examples/databases/create-operations.md (1)

1-24: LGTM!

The example effectively demonstrates the createOperations API for batching operations within a transaction. The structure is clear and follows the expected format.

docs/examples/databases/list-documents.md (1)

12-13: LGTM!

The optional transactionId parameter is correctly added and consistent with the transaction API surface expansion.

docs/examples/databases/delete-transaction.md (1)

1-13: LGTM!

The example correctly demonstrates the deleteTransaction API usage.

docs/examples/tablesdb/upsert-row.md (1)

14-15: LGTM!

The addition of transactionId is consistent with the transaction support, and the trailing comma improves formatting consistency.

docs/examples/tablesdb/create-operations.md (1)

1-24: LGTM!

The example correctly demonstrates TablesDB.createOperations for transactional table operations. The structure appropriately mirrors the Databases API counterpart.

src/models.ts (2)

218-230: LGTM!

The TransactionList type follows the established pattern of other list types in the codebase (e.g., DocumentList, RowList) with a consistent structure.


1255-1283: LGTM!

The Transaction type is well-structured with appropriate field types and clear documentation. The status field documents the possible values inline, which is consistent with how other status fields are handled in this codebase.

Comment on lines +20 to +21
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Correct the permissions string literal.

["read("any")"] is syntactically invalid—copying this snippet will throw. Use single quotes (or escape the inner quotes) so developers can paste and run the example as-is.

-    permissions: ["read("any")"], // optional
+    permissions: ['read("any")'], // optional
📝 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
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
permissions: ['read("any")'], // optional
transactionId: '<TRANSACTION_ID>' // optional
🤖 Prompt for AI Agents
In docs/examples/databases/create-document.md around lines 20 to 21, the
permissions entry uses invalid nested double quotes ("read("any")"); fix it by
using single quotes for the inner string or by escaping the inner quotes so the
permissions array contains a valid string (for example read('any')), keeping the
transactionId line unchanged.

Comment on lines +14 to +15
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Correct the permissions string literal.

"read("any")" is malformed JavaScript; escaping or switching quote types keeps the example usable.

Apply this diff:

-    permissions: ["read("any")"], // optional
+    permissions: ['read("any")'], // optional
📝 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
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
permissions: ['read("any")'], // optional
transactionId: '<TRANSACTION_ID>' // optional
🤖 Prompt for AI Agents
docs/examples/databases/upsert-document.md lines 14-15: the permissions string
literal is malformed ("read("any")"); change it to a valid JS string by either
using single outer quotes with double inner quotes like ['read("any")'], using
double outer quotes and single inner quotes like ["read('any')"], or escaping
the inner quotes like "read(\"any\")", and update the example accordingly so it
parses.

Comment on lines +20 to +21
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix invalid string literal in example.

"read("any")" terminates early and breaks copy/paste. Use single quotes outside or escape the inner quotes so the snippet stays valid.

Apply this diff:

-    permissions: ["read("any")"], // optional
+    permissions: ['read("any")'], // optional
📝 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
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
permissions: ['read("any")'], // optional
transactionId: '<TRANSACTION_ID>' // optional
🤖 Prompt for AI Agents
In docs/examples/tablesdb/create-row.md around lines 20 to 21 the example has an
invalid string literal permissions: ["read("any")"] which terminates early;
replace it with a valid quoted string such as permissions: ['read("any")'] or
escape the inner quotes permissions: ["read(\"any\")"] so the snippet is
syntactically correct and copy/paste-safe.

Comment on lines +14 to +15
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix invalid permissions string literal.

["read("any")"] is not valid JavaScript/TypeScript because the inner quotes terminate the string. The snippet breaks if copied verbatim. Please switch to single quotes (or escape the inner quotes) to keep the example runnable.

-    permissions: ["read("any")"], // optional
+    permissions: ['read("any")'], // optional
📝 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
permissions: ["read("any")"], // optional
transactionId: '<TRANSACTION_ID>' // optional
permissions: ['read("any")'], // optional
transactionId: '<TRANSACTION_ID>' // optional
🤖 Prompt for AI Agents
In docs/examples/tablesdb/update-row.md around lines 14 to 15, the example uses
an invalid string literal permissions: ["read("any")"] which breaks JS/TS;
change it to use valid quoting or escaping such as permissions: ['read("any")']
or permissions: ["read(\"any\")"] so the inner quotes do not terminate the
string, and update the example accordingly to keep it runnable.

@abnegate abnegate merged commit aa201b7 into main Oct 9, 2025
2 checks passed
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.

2 participants