diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 9a6ba173d2..48e1fb1c28 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -2,9 +2,6 @@ name: Staging deployment on: workflow_dispatch: - push: - branches: - - main concurrency: group: ${{ github.workflow }} diff --git a/.optimize-cache.json b/.optimize-cache.json index ef218fa5e1..ae72c4c101 100644 --- a/.optimize-cache.json +++ b/.optimize-cache.json @@ -256,6 +256,7 @@ "static/images/blog/anthropic-just-launched-claude-fable-5-and-claude-mythos-5/cover.png": "45721aba1b005e1b02d2b585c69d3e48227bea22b8c7253aaeda2ce67bb79b1d", "static/images/blog/anthropic-just-launched-claude-for-small-business/cover.png": "9b89a91dab0f56e4d49777ca4a370c558edca339e573c155d6c1838f04a1dbd6", "static/images/blog/anthropic-just-launched-claude-opus-48-with-fast-mode-and-dynamic-workflows/cover.png": "0fba6f3f51a4fc24f02ac6c14b1f098277bd8a8d3e555c024b3dca0b29d20167", + "static/images/blog/anthropic-launches-free-claude-access-for-us-k-12-teachers/cover.png": "5af971e028a2acca04c08342ab035a422b5eea67367d0a71c33eeedac50f280c", "static/images/blog/apply-appwrite-how/cover.png": "d23f45ced245b42c8712c021f5d2068c17aebd94fd049cb90222cb9647a41a4a", "static/images/blog/appwrite-1-8-0-self-hosted-release/cover.png": "c15a9d88ccd16c2dc8333dc74e715e1f4a6c7818d3b4a05f4d68342eacdc0523", "static/images/blog/appwrite-1-8-1-self-hosted-release/cover.png": "82f0a396c56b6b299b24133079acc6a317c66b2bf02fd91f4862bd3be0f8f373", @@ -633,6 +634,7 @@ "static/images/blog/february-and-march-product-update-realtime-queries-appwrite-skills-and-new-database-features/Introducing_Realtime_queries.png": "0b632e9ceac3a763f5ba2ed50ab54fffe389fde34fcdfb7ad99599ec7ae83b9e", "static/images/blog/february-and-march-product-update-realtime-queries-appwrite-skills-and-new-database-features/Relationship_queries.png": "2d9772691f05b1be3ec6cb954d77babc10d5666c9994fe3975d2a078facc87b8", "static/images/blog/file-tokens.png": "23d2fa4a88db2d9548f43f95df15b5ca60d512481570ed2d1b3d66ce1b1f504f", + "static/images/blog/file-vs-object-vs-block-storage-whats-the-difference/cover.png": "441cc26959c276c917e3da173c31aec6893b1209a609954f1f981836efa3800b", "static/images/blog/firebase-vs-open-source-tradeoffs/cover.png": "1be4185b4fa90c5f37e96003a74b8b55c31956d0258c70000fdec0990f2496eb", "static/images/blog/first-pr.png": "f369419a756ccb2c784dac916d79a1cc33317fa4c43f37c7f41ae62bf0a603dd", "static/images/blog/first-pr1.png": "256144fd88d0564c239cb73c16882113e4fe2cb23156fcbc4f15f6f70437faaf", @@ -699,6 +701,9 @@ "static/images/blog/google-oauth-expo/login-successful.png": "441ef69e3ba8716c4ff4c20dc8c31f8f3f418010a11ff1e74585645bad414f74", "static/images/blog/gpt-5-5-launch/card-problem.png": "9cfd1fa44c5f8d76a54904d1e656595f1580721d498952a96105dd6f9ddc82fd", "static/images/blog/gpt-5-5-launch/cover.png": "768138556cc8a3c1645ff1c602ea1ac5ba2eb373f8f642d2c023e6380950ec08", + "static/images/blog/gpt-56-is-here-openais-efficient-frontier-model/cover.png": "2156c5047fa2630e148ea0fd5189c4d08579b5c96e92530c4ae45b642acb6589", + "static/images/blog/grok-45-coding-model/cover.png": "b40f87952b940767f393a93a7628f8277119862a3a3ac7b7d40d7ee5679213ff", + "static/images/blog/grok-build-open-source/cover.png": "b6550e801f952ba0446227c7f9295d3e5beb12e5d7f9e62547c5a3ffa78e674f", "static/images/blog/hacktoberfest-2023.png": "e0521ba26e59dacf91072391f7eb0df0e724457961fec4cb04a4914b31dd0024", "static/images/blog/hacktoberfest2023-swag.png": "7a0af270f7fe24c53e2497ca59bead84255d2d2e882dd38473b1bc6bb0a22d1f", "static/images/blog/handle-cors-in-serverless-functions/cover.png": "9db00c07cedfbc97f7c4a1a79d1ce1f0d31adab3ea246935ac9bdc9f47fc1e4c", @@ -825,6 +830,11 @@ "static/images/blog/introducing-python-machine-learning-runtime/cover.png": "2976f7c650ab992ade016df1767c8b783da8173f8a3bbe10549fe4d3e4767536", "static/images/blog/introducing-python-machine-learning-runtime/create-function.png": "0728b8ed66cd81e826d2d0a5b70e9f572d415f995065cf44feed2e22ce50e492", "static/images/blog/introducing-python-machine-learning-runtime/settings-timeout.png": "84214c72048b9911dfb2b9b40b62dd715f856c01badae58b148066be137fdfb5", + "static/images/blog/june-product-update-react-library-password-strength-baa-and-more/Appwrite_plugin_for_Claude_Code_is_now_in_the_official_Claude_marketplace.jpg": "f8679e1c03a01ccc2a3a1d3709d609ee8dbd9af63e9548cdcc336059457dae3c", + "static/images/blog/june-product-update-react-library-password-strength-baa-and-more/cover.png": "b636e349b4ecc0d569967d449ddb665e3ae1a6ed554224b1a643e4efab18d251", + "static/images/blog/june-product-update-react-library-password-strength-baa-and-more/introducing_self-serve_baa.png": "4d4ed038ee7e94249857342f6d317b31dbb5b44410941fa14f6280e0bc8d938b", + "static/images/blog/june-product-update-react-library-password-strength-baa-and-more/Introducing_the_Appwrite_React_library.png": "f69d9adae872ab44368fd32159ece9daf621cdf002ab78461f7f1d07b66dba73", + "static/images/blog/june-product-update-react-library-password-strength-baa-and-more/Password_Strength.png": "bc6a351aa59b845d6a9513ec4a4993c393b3059c9a7d324c999bea52142d8648", "static/images/blog/kcollect.png": "d044d69e18de7dd4af75213b7f4cf131529f43875352d7db86fe80c274466242", "static/images/blog/local-development-guide/localdev-cover.png": "07cce5e779991c560d2e8c58b280803ea8ebcfc8775bcc75e959d76b01409fa7", "static/images/blog/logo.png": "6df582f74767156f37ced895ebeb6b5a656858301dd09539cbc84157a6a54ed3", @@ -1258,15 +1268,20 @@ "static/images/blog/vibe-coding-vs-traditional-development/cover.png": "ed973e32ed844c5bb24dff7946cb531d7cfc74e31fee5cd7208391f4feb6fc5d", "static/images/blog/webp-support-for-safari/cover.png": "ea4e965ffe21500f3552073bb7ca325d453020cf095d67164329edbda3f1c799", "static/images/blog/what-developers-actually-want-from-a-backend-platform/cover.png": "0c540d48b12cd7031e3cadaf4223086ded946b42dc283c641cfa024311b2ec36", + "static/images/blog/what-is-a-storage-bucket/cover.png": "3dc114305196a7061b9bf55035c3a72470091df8b60096ea4fbe5606705a349b", "static/images/blog/what-is-an-ai-backend/cover.png": "cb36f49035cbdcd97a70ac658783741f275d3a220b7cfd16b39d4fb86a929edd", "static/images/blog/what-is-cdn/cover.png": "ef77860288e150c6c22f3950a5eae4c88aefefb6db204f10c2a0544e51548703", "static/images/blog/what-is-ciam/cover.png": "45a5261ae1bb8a38777f60a21ea60426c0832e3d58bf3164100548400d388ce1", "static/images/blog/what-is-cicd-a-complete-guide-for-developers/cover.png": "7abddce55b1467188faab83abd58189173bf9aba84de3d9f28fff0be8c6e9276", + "static/images/blog/what-is-cloud-storage-an-expert-guide-for-developers/cover.png": "b7f545dbe9334d60f214e748ddfcea47484530a97f30ecf579d064a053c2821d", "static/images/blog/what-is-docker-a-simple-guide-for-developers/cover.png": "acd9c50ad749fcf676dd58b38cc6bbffba913bf5d817c6b725bd2c305088689e", + "static/images/blog/what-is-kubernetes-an-expert-guide-for-developers/cover.png": "a7601f375841b143d62511fe3bbfb4bacb6989ddc56613f772b7dcd3d5e90688", "static/images/blog/what-is-mcp/claude-mcp-chat.png": "26842cfebca3ec2cec89448e1c0d7ddb3f5421cc57acdb8780d48d30a54cad82", "static/images/blog/what-is-mcp/claude-mcp-tools.png": "3a5ae700867b8671b5c9e3af61b094aeb64611168463db66ff440e0d427ac6bc", "static/images/blog/what-is-mcp/cover.png": "dc4537990c91d6f1768c5ab8775e5c52239eb901b15e2e74fce8b5a018855c32", + "static/images/blog/what-is-object-storage-a-beginners-guide/cover.png": "77f961972c0249f5cc77634e68b4c0b6b285887cc62a25114a5af4b5906a6a3c", "static/images/blog/what-is-redis-a-complete-guide-for-developers/cover.png": "b7b87a372bbb99421c2ab6df37430da960728b5cf339f1803c432644154c764f", + "static/images/blog/what-is-serverless-an-expert-guide-for-developers/cover.png": "fd88e32613ca877625cd69e0e38ba76c3c2cc73da05b789739928712bdd7b454", "static/images/blog/when-custom-backend-stops-being-worth-it/cover.png": "d03b13c4e8f3294823a7883cdae89ca18a4030b170c51f597bd139c9ca274793", "static/images/blog/why-ai-generated-apps-need-backend/cover.png": "8761878c13c51dd8a720a625606b89b93d9c56651aed636fa1b2bd346bd4fd82", "static/images/blog/why-developers-choose-appwrite-auth/cover.png": "f56c37ebfc25191e113b928ff3cf144563be740159e46d75a427bdafdd11214b", diff --git a/src/partials/auth-security.md b/src/partials/auth-security.md index bd1eb8c5a0..0763f3bd89 100644 --- a/src/partials/auth-security.md +++ b/src/partials/auth-security.md @@ -23,7 +23,7 @@ You can change the session limit in the **Security** tab of the Auth Service in Security is very important to protect users' data and privacy. Appwrite uses a [permissions model](/docs/advanced/security/permissions) coupled with user sessions to ensure users need correct permissions to access resources. -With all Appwrite services, including databases and storage, access is granted at the collection, bucket, document, or file level. +With all Appwrite services, including databases and storage, access is granted at the table, bucket, row, or file level. These permissions are enforced for client SDKs and server SDKs when using JWT, but are ignored when using a server SDK with an API key. # Password strength {% #password-strength %} diff --git a/src/routes/(marketing)/(components)/hero-banner.svelte b/src/routes/(marketing)/(components)/hero-banner.svelte index 960d2aa359..2559951291 100644 --- a/src/routes/(marketing)/(components)/hero-banner.svelte +++ b/src/routes/(marketing)/(components)/hero-banner.svelte @@ -12,7 +12,12 @@ const { title, href, icon = 'sparkle' }: Props = $props(); - + {#if icon === 'mongo'} Collections API documentation.` + description: `This is a relatively new API. For details on the previous version and its terminology, see the legacy API documentation.` }); } else { headerSectionInfoAlert.set(null); diff --git a/src/routes/docs/products/databases/atomic-numeric-operations/+page.markdoc b/src/routes/docs/products/databases/atomic-numeric-operations/+page.markdoc index 9de1237ed7..b2b439e226 100644 --- a/src/routes/docs/products/databases/atomic-numeric-operations/+page.markdoc +++ b/src/routes/docs/products/databases/atomic-numeric-operations/+page.markdoc @@ -513,24 +513,24 @@ For complex updates that include both atomic operations and regular field change {% multicode %} ```client-web // First, increment the likes atomically -const likeResult = await tablesDB.incrementRowColumn( - '', - '', - '', - 'likes', // column - 1 // value -); +const likeResult = await tablesDB.incrementRowColumn({ + databaseId: '', + tableId: '', + rowId: '', + column: 'likes', + value: 1 +}); // Then, update other fields -const updateResult = await tablesDB.updateRow( - '', - '', - '', - { +const updateResult = await tablesDB.updateRow({ + databaseId: '', + tableId: '', + rowId: '', + data: { lastLikedBy: userId, lastLikedAt: new Date().toISOString() } -); +}); ``` ```client-flutter // First, increment the likes atomically @@ -597,24 +597,24 @@ val updateResult = tablesDB.updateRow( ``` ```server-nodejs // First, increment the likes atomically -const likeResult = await tablesDB.incrementRowColumn( - '', - '', - '', - 'likes', // column - 1 // value -); +const likeResult = await tablesDB.incrementRowColumn({ + databaseId: '', + tableId: '', + rowId: '', + column: 'likes', + value: 1 +}); // Then, update other fields -const updateResult = await tablesDB.updateRow( - '', - '', - '', - { +const updateResult = await tablesDB.updateRow({ + databaseId: '', + tableId: '', + rowId: '', + data: { lastLikedBy: userId, lastLikedAt: new Date().toISOString() } -); +}); ``` ```server-python # First, increment the likes atomically diff --git a/src/routes/docs/products/databases/bulk-operations/+page.markdoc b/src/routes/docs/products/databases/bulk-operations/+page.markdoc index 07a93db88c..d157489430 100644 --- a/src/routes/docs/products/databases/bulk-operations/+page.markdoc +++ b/src/routes/docs/products/databases/bulk-operations/+page.markdoc @@ -56,10 +56,10 @@ const client = new sdk.Client() const tablesDB = new sdk.TablesDB(client); -const result = await tablesDB.createRows( - '', - '', - [ +const result = await tablesDB.createRows({ + databaseId: '', + tableId: '', + rows: [ { $id: sdk.ID.unique(), name: 'Row 1' @@ -69,7 +69,7 @@ const result = await tablesDB.createRows( name: 'Row 2' } ] -); +}); ``` ```server-python @@ -155,16 +155,16 @@ const client = new sdk.Client() const tablesDB = new sdk.TablesDB(client); -const result = await tablesDB.updateRows( - '', - '', - { +const result = await tablesDB.updateRows({ + databaseId: '', + tableId: '', + data: { status: 'published' }, - [ + queries: [ sdk.Query.equal('status', 'draft') ] -); +}); ``` ```server-python @@ -242,10 +242,10 @@ const client = new sdk.Client() const tablesDB = new sdk.TablesDB(client); -const result = await tablesDB.upsertRows( - '', - '', - [ +const result = await tablesDB.upsertRows({ + databaseId: '', + tableId: '', + rows: [ { $id: sdk.ID.unique(), name: 'New Row 1' @@ -255,7 +255,7 @@ const result = await tablesDB.upsertRows( name: 'New Row 2' } ] -); +}); ``` ```server-python @@ -342,13 +342,13 @@ const client = new sdk.Client() const tablesDB = new sdk.TablesDB(client); -const result = await tablesDB.deleteRows( - '', - '', - [ +const result = await tablesDB.deleteRows({ + databaseId: '', + tableId: '', + queries: [ sdk.Query.equal('status', 'archived') ] -); +}); ``` ```server-python diff --git a/src/routes/docs/products/databases/csv-imports/+page.markdoc b/src/routes/docs/products/databases/csv-imports/+page.markdoc index 59d3244c23..4efa897d60 100644 --- a/src/routes/docs/products/databases/csv-imports/+page.markdoc +++ b/src/routes/docs/products/databases/csv-imports/+page.markdoc @@ -145,4 +145,4 @@ CSV imports run as background tasks. The Console displays a floating progress ba - [Appwrite CLI](/docs/command-line) - [Database Permissions](/docs/products/databases/permissions) -- [Database API Reference](/docs/references/cloud/client-web/databases) +- [TablesDB API Reference](/docs/references/cloud/client-web/tablesDB) diff --git a/src/routes/docs/products/databases/databases/+page.markdoc b/src/routes/docs/products/databases/databases/+page.markdoc index ea3dd1347c..dd2e32ebdd 100644 --- a/src/routes/docs/products/databases/databases/+page.markdoc +++ b/src/routes/docs/products/databases/databases/+page.markdoc @@ -100,7 +100,7 @@ client = Client() tablesDB = TablesDB(client) -result = tablesDB.create('', '') +result = tablesDB.create(database_id='', name='') ``` ```ruby require 'Appwrite' diff --git a/src/routes/docs/products/databases/operators/+page.markdoc b/src/routes/docs/products/databases/operators/+page.markdoc index 53ebfaa1ed..f50f0180c4 100644 --- a/src/routes/docs/products/databases/operators/+page.markdoc +++ b/src/routes/docs/products/databases/operators/+page.markdoc @@ -204,10 +204,10 @@ client = Client() tablesDB = TablesDB(client) result = tablesDB.update_row( - '', - '', - '', - { 'letters': Operator.arrayAppend(['c']) } + database_id='', + table_id='', + row_id='', + data={ 'letters': Operator.arrayAppend(['c']) } ) ``` ```server-dotnet @@ -246,10 +246,10 @@ client tablesDB = TablesDB.new(client) result = tablesDB.update_row( - '', - '', - '', - { 'letters' => Operator.arrayAppend(['c']) } + database_id: '', + table_id: '', + row_id: '', + data: { 'letters' => Operator.arrayAppend(['c']) } ) ``` ```server-java @@ -1331,10 +1331,10 @@ client = Client() tablesDB = TablesDB(client) result = tablesDB.update_row( - '', - '', - '', - { 'upvotes': Operator.increment(1) } + database_id='', + table_id='', + row_id='', + data={ 'upvotes': Operator.increment(1) } ) ``` ```server-dotnet @@ -1373,10 +1373,10 @@ client tablesDB = TablesDB.new(client) result = tablesDB.update_row( - '', - '', - '', - { 'upvotes' => Operator.increment(1) } + database_id: '', + table_id: '', + row_id: '', + data: { 'upvotes' => Operator.increment(1) } ) ``` ```server-java @@ -1618,10 +1618,10 @@ client = Client() tablesDB = TablesDB(client) result = tablesDB.update_row( - '', - '', - '', - { 'books': Operator.arrayAppend(['The Great Gatsby']) } + database_id='', + table_id='', + row_id='', + data={ 'books': Operator.arrayAppend(['The Great Gatsby']) } ) ``` ```server-dotnet @@ -1660,10 +1660,10 @@ client tablesDB = TablesDB.new(client) result = tablesDB.update_row( - '', - '', - '', - { 'books' => Operator.arrayAppend(['The Great Gatsby']) } + database_id: '', + table_id: '', + row_id: '', + data: { 'books' => Operator.arrayAppend(['The Great Gatsby']) } ) ``` ```server-java @@ -1905,10 +1905,10 @@ client = Client() tablesDB = TablesDB(client) result = tablesDB.update_row( - '', - '', - '', - { 'scheduledDeletion': Operator.dateAddDays(30) } + database_id='', + table_id='', + row_id='', + data={ 'scheduledDeletion': Operator.dateAddDays(30) } ) ``` ```server-dotnet @@ -1947,10 +1947,10 @@ client tablesDB = TablesDB.new(client) result = tablesDB.update_row( - '', - '', - '', - { 'scheduledDeletion' => Operator.dateAddDays(30) } + database_id: '', + table_id: '', + row_id: '', + data: { 'scheduledDeletion' => Operator.dateAddDays(30) } ) ``` ```server-java @@ -2042,7 +2042,10 @@ await tablesDB.updateRow({ }); // Commit the transaction -await tablesDB.updateTransaction(tx.$id, 'commit'); +await tablesDB.updateTransaction({ + transactionId: tx.$id, + commit: true +}); ``` ```server-nodejs const sdk = require('node-appwrite'); @@ -2071,7 +2074,10 @@ await tablesDB.updateRow({ }); // Commit the transaction -await tablesDB.updateTransaction(tx.$id, 'commit'); +await tablesDB.updateTransaction({ + transactionId: tx.$id, + commit: true +}); ``` ```client-flutter import 'package:appwrite/appwrite.dart'; @@ -2270,18 +2276,18 @@ tx = tablesDB.create_transaction() # Update row with operators inside the transaction result = tablesDB.update_row( - '', - '', - '', - { - 'upvotes': Operator.increment(1), - 'lastModified': Operator.dateSetNow() - }, - transaction_id=tx.id + database_id='', + table_id='', + row_id='', + data={ + 'upvotes': Operator.increment(1), + 'lastModified': Operator.dateSetNow() + }, + transaction_id=tx.id ) # Commit the transaction -tablesDB.update_transaction(tx.id, 'commit') +tablesDB.update_transaction(transaction_id=tx.id, commit=True) ``` ```server-dotnet using Appwrite; @@ -2332,18 +2338,18 @@ tx = tablesDB.create_transaction # Update row with operators inside the transaction result = tablesDB.update_row( - '', - '', - '', - { - 'upvotes' => Operator.increment(1), - 'lastModified' => Operator.dateSetNow() - }, - transaction_id: tx['$id'] + database_id: '', + table_id: '', + row_id: '', + data: { + 'upvotes' => Operator.increment(1), + 'lastModified' => Operator.dateSetNow() + }, + transaction_id: tx['$id'] ) # Commit the transaction -tablesDB.update_transaction(tx['$id'], 'commit') +tablesDB.update_transaction(transaction_id: tx['$id'], commit: true) ``` ```server-java import io.appwrite.Client; @@ -2481,7 +2487,10 @@ await tablesDB.createOperations({ }); // Commit the transaction -await tablesDB.updateTransaction(tx.$id, 'commit'); +await tablesDB.updateTransaction({ + transactionId: tx.$id, + commit: true +}); ``` ```server-nodejs const sdk = require('node-appwrite'); @@ -2524,7 +2533,10 @@ await tablesDB.createOperations({ }); // Commit the transaction -await tablesDB.updateTransaction(tx.$id, 'commit'); +await tablesDB.updateTransaction({ + transactionId: tx.$id, + commit: true +}); ``` ```client-flutter import 'package:appwrite/appwrite.dart'; @@ -2818,7 +2830,7 @@ tablesDB.create_operations( ) # Commit the transaction -tablesDB.update_transaction(tx.id, 'commit') +tablesDB.update_transaction(transaction_id=tx.id, commit=True) ``` ```server-dotnet using Appwrite; @@ -2914,7 +2926,7 @@ tablesDB.create_operations( ) # Commit the transaction -tablesDB.update_transaction(tx['$id'], 'commit') +tablesDB.update_transaction(transaction_id: tx['$id'], commit: true) ``` ```server-java import io.appwrite.Client; @@ -3035,4 +3047,4 @@ async fn main() -> Result<(), Box> { Ok(()) } ``` -{% /multicode %} \ No newline at end of file +{% /multicode %} diff --git a/src/routes/docs/products/databases/pagination/+page.markdoc b/src/routes/docs/products/databases/pagination/+page.markdoc index a138a22014..089bac7e3f 100644 --- a/src/routes/docs/products/databases/pagination/+page.markdoc +++ b/src/routes/docs/products/databases/pagination/+page.markdoc @@ -30,24 +30,24 @@ const client = new Client() const tablesDB = new TablesDB(client); // Page 1 -const page1 = await tablesDB.listRows( - '', - '', - [ +const page1 = await tablesDB.listRows({ + databaseId: '', + tableId: '', + queries: [ Query.limit(25), Query.offset(0) ] -); +}); // Page 2 -const page2 = await tablesDB.listRows( - '', - '', - [ +const page2 = await tablesDB.listRows({ + databaseId: '', + tableId: '', + queries: [ Query.limit(25), Query.offset(25) ] -); +}); ``` ```client-flutter import 'package:appwrite/appwrite.dart'; @@ -166,25 +166,25 @@ const client = new Client() const tablesDB = new TablesDB(client); // Page 1 -const page1 = await tablesDB.listRows( - '', - '', - [ +const page1 = await tablesDB.listRows({ + databaseId: '', + tableId: '', + queries: [ Query.limit(25), ] -); +}); const lastId = page1.rows[page1.rows.length - 1].$id; // Page 2 -const page2 = await tablesDB.listRows( - '', - '', - [ +const page2 = await tablesDB.listRows({ + databaseId: '', + tableId: '', + queries: [ Query.limit(25), Query.cursorAfter(lastId), ] -); +}); ``` ```client-flutter diff --git a/src/routes/docs/products/databases/queries/+page.markdoc b/src/routes/docs/products/databases/queries/+page.markdoc index 48628e4df8..7b501d7b0f 100644 --- a/src/routes/docs/products/databases/queries/+page.markdoc +++ b/src/routes/docs/products/databases/queries/+page.markdoc @@ -256,9 +256,9 @@ client = Client() tablesDB = TablesDB(client) result = tablesDB.list_rows( - '', - '', - [ + database_id='', + table_id='', + queries=[ Query.equal('title', ['Avatar', 'Lord of the Rings']), Query.greater_than('year', 1999) ] @@ -337,7 +337,7 @@ By default, rows return only their own fields: {% multicode %} ```client-web -const doc = await tablesDB.getRow({ +const row = await tablesDB.getRow({ databaseId: '', tableId: '', rowId: '', @@ -345,7 +345,7 @@ const doc = await tablesDB.getRow({ }); ``` ```client-flutter -final doc = await tablesDB.getRow( +final row = await tablesDB.getRow( databaseId: '', tableId: '', rowId: '', @@ -353,19 +353,23 @@ final doc = await tablesDB.getRow( ); ``` ```server-python -doc = tablesDB.get_row( - '', '', '', - [Query.select(["name", "age"])] +row = tablesDB.get_row( + database_id='', + table_id='', + row_id='', + queries=[Query.select(["name", "age"])] ) ``` ```server-ruby -doc = tablesDB.get_row( - '', '', '', - [Query.select(["name", "age"])] +row = tablesDB.get_row( + database_id: '', + table_id: '', + row_id: '', + queries: [Query.select(["name", "age"])] ) ``` ```server-nodejs -const doc = await tablesDB.getRow({ +const row = await tablesDB.getRow({ databaseId: '', tableId: '', rowId: '', @@ -373,13 +377,13 @@ const doc = await tablesDB.getRow({ }); ``` ```server-php -$doc = $tablesDB->getRow( +$row = $tablesDB->getRow( '', '', '', [Query::select(["name", "age"])] ); ``` ```server-rust -let doc = tables_db.get_row( +let row = tables_db.get_row( "", "", "", @@ -388,7 +392,7 @@ let doc = tables_db.get_row( ).await?; ``` ```client-apple -let doc = try await tablesDB.getRow( +let row = try await tablesDB.getRow( databaseId: "", tableId: "", rowId: "", @@ -407,7 +411,7 @@ Use the `*` wildcard to load all fields from related rows: {% multicode %} ```client-web -const doc = await tablesDB.getRow({ +const row = await tablesDB.getRow({ databaseId: '', tableId: '', rowId: '', @@ -415,7 +419,7 @@ const doc = await tablesDB.getRow({ }); ``` ```client-flutter -final doc = await tablesDB.getRow( +final row = await tablesDB.getRow( databaseId: '', tableId: '', rowId: '', @@ -423,19 +427,23 @@ final doc = await tablesDB.getRow( ); ``` ```server-python -doc = tablesDB.get_row( - '', '', '', - [Query.select(["*", "reviews.*"])] +row = tablesDB.get_row( + database_id='', + table_id='', + row_id='', + queries=[Query.select(["*", "reviews.*"])] ) ``` ```server-ruby -doc = tablesDB.get_row( - '', '', '', - [Query.select(["*", "reviews.*"])] +row = tablesDB.get_row( + database_id: '', + table_id: '', + row_id: '', + queries: [Query.select(["*", "reviews.*"])] ) ``` ```server-nodejs -const doc = await tablesDB.getRow({ +const row = await tablesDB.getRow({ databaseId: '', tableId: '', rowId: '', @@ -443,13 +451,13 @@ const doc = await tablesDB.getRow({ }); ``` ```server-php -$doc = $tablesDB->getRow( +$row = $tablesDB->getRow( '', '', '', [Query::select(["*", "reviews.*"])] ); ``` ```server-rust -let doc = tables_db.get_row( +let row = tables_db.get_row( "", "", "", @@ -458,7 +466,7 @@ let doc = tables_db.get_row( ).await?; ``` ```client-apple -let doc = try await tablesDB.getRow( +let row = try await tablesDB.getRow( databaseId: "", tableId: "", rowId: "", @@ -478,7 +486,7 @@ For precise control, select only specific fields from related rows: {% multicode %} ```client-web -const doc = await tablesDB.getRow({ +const row = await tablesDB.getRow({ databaseId: '', tableId: '', rowId: '', @@ -486,7 +494,7 @@ const doc = await tablesDB.getRow({ }); ``` ```client-flutter -final doc = await tablesDB.getRow( +final row = await tablesDB.getRow( databaseId: '', tableId: '', rowId: '', @@ -494,19 +502,23 @@ final doc = await tablesDB.getRow( ); ``` ```server-python -doc = tablesDB.get_row( - '', '', '', - [Query.select(["name", "age", "reviews.author", "reviews.rating"])] +row = tablesDB.get_row( + database_id='', + table_id='', + row_id='', + queries=[Query.select(["name", "age", "reviews.author", "reviews.rating"])] ) ``` ```server-ruby -doc = tablesDB.get_row( - '', '', '', - [Query.select(["name", "age", "reviews.author", "reviews.rating"])] +row = tablesDB.get_row( + database_id: '', + table_id: '', + row_id: '', + queries: [Query.select(["name", "age", "reviews.author", "reviews.rating"])] ) ``` ```server-nodejs -const doc = await tablesDB.getRow({ +const row = await tablesDB.getRow({ databaseId: '', tableId: '', rowId: '', @@ -515,13 +527,13 @@ const doc = await tablesDB.getRow({ // Result: { name: "John", age: 30, reviews: [{ author: "...", rating: 5 }] } ``` ```server-php -$doc = $tablesDB->getRow( +$row = $tablesDB->getRow( '', '', '', [Query::select(["name", "age", "reviews.author", "reviews.rating"])] ); ``` ```server-rust -let doc = tables_db.get_row( +let row = tables_db.get_row( "", "", "", @@ -530,7 +542,7 @@ let doc = tables_db.get_row( ).await?; ``` ```client-apple -let doc = try await tablesDB.getRow( +let row = try await tablesDB.getRow( databaseId: "", tableId: "", rowId: "", @@ -985,11 +997,11 @@ Query::is_not_null("name").to_string() ``` {% /multicode %} -## String operations {% #string-operations %} +## Text operations {% #text-operations %} ### Starts with {% #starts-with %} -Returns rows if a string column starts with a substring. +Returns rows if a text column starts with a substring. {% multicode %} ```client-web @@ -1026,7 +1038,7 @@ Query::starts_with("name", "Once upon a time").to_string() ### Not starts with {% #not-starts-with %} -Returns rows if a string column does not start with a substring. +Returns rows if a text column does not start with a substring. {% multicode %} ```client-web @@ -1072,7 +1084,7 @@ Query::not_starts_with("name", "Once upon a time").to_string() ### Ends with {% #ends-with %} -Returns rows if a string column ends with a substring. +Returns rows if a text column ends with a substring. {% multicode %} ```client-web @@ -1109,7 +1121,7 @@ Query::ends_with("name", "happily ever after.").to_string() ### Not ends with {% #not-ends-with %} -Returns rows if a string column does not end with a substring. +Returns rows if a text column does not end with a substring. {% multicode %} ```client-web @@ -1155,62 +1167,62 @@ Query::not_ends_with("name", "happily ever after.").to_string() ### Contains {% #contains %} -Returns rows if the array column contains the specified elements or if a string column contains the specified substring. Also supported for spatial types. +Returns rows if the array column contains the specified elements or if a text column contains the specified substring. Also supported for spatial types. {% multicode %} ```client-web // For arrays Query.contains("ingredients", ['apple', 'banana']) -// For strings +// For text columns Query.contains("name", "Tom") ``` ```client-flutter // For arrays Query.contains("ingredients", ['apple', 'banana']) -// For strings +// For text columns Query.contains("name", "Tom") ``` ```server-python # For arrays Query.contains("ingredients", ['apple', 'banana']) -# For strings +# For text columns Query.contains("name", "Tom") ``` ```server-ruby # For arrays Query.contains("ingredients", ['apple', 'banana']) -# For strings +# For text columns Query.contains("name", "Tom") ``` ```server-deno // For arrays Query.contains("ingredients", ['apple', 'banana']) -// For strings +// For text columns Query.contains("name", "Tom") ``` ```server-php // For arrays Query::contains("ingredients", ['apple', 'banana']) -// For strings +// For text columns Query::contains("name", "Tom") ``` ```client-apple // For arrays Query.contains("ingredients", value: ["apple", "banana"]) -// For strings +// For text columns Query.contains("name", value: "Tom") ```server-go // For arrays query.Contains("ingredients", []string{"apple", "banana"}) -// For strings +// For text columns query.Contains("name", "Tom") ``` ```server-rust @@ -1220,14 +1232,14 @@ Query::contains("ingredients", Value::Array(vec![ Value::String("banana".to_string()), ])).to_string() -// For strings +// For text columns Query::contains("name", "Tom").to_string() ``` ```http # For arrays {"method":"contains","column":"ingredients","values":["apple","banana"]} -# For strings +# For text columns {"method":"contains","column":"name","values":["Tom"]} ``` {% /multicode %} @@ -1235,7 +1247,7 @@ Query::contains("name", "Tom").to_string() ### Not contains {% #not-contains %} Returns rows if the array column does not contain the specified -elements, or if a string column does not contain the specified +elements, or if a text column does not contain the specified substring. Also supported for spatial types. {% multicode %} @@ -1243,111 +1255,111 @@ substring. Also supported for spatial types. // For arrays Query.notContains("ingredients", ['apple', 'banana']) -// For strings +// For text columns Query.notContains("name", "Tom") ``` ```client-flutter // For arrays Query.notContains("ingredients", ['apple', 'banana']) -// For strings +// For text columns Query.notContains("name", "Tom") ``` ```client-react-native // For arrays Query.notContains("ingredients", ['apple', 'banana']) -// For strings +// For text columns Query.notContains("name", "Tom") ``` ```client-apple // For arrays Query.notContains("ingredients", value: ['apple', 'banana']) -// For strings +// For text columns Query.notContains("name", value: "Tom") ``` ```client-android-kotlin // For arrays Query.notContains("ingredients", ['apple', 'banana']) -// For strings +// For text columns Query.notContains("name", "Tom") ``` ```client-android-java // For arrays Query.notContains("ingredients", Arrays.asList("apple", "banana")) -// For strings +// For text columns Query.notContains("name", "Tom") ``` ```server-python # For arrays Query.not_contains("ingredients", ['apple', 'banana']) -# For strings +# For text columns Query.not_contains("name", "Tom") ``` ```server-ruby # For arrays Query.not_contains("ingredients", ['apple', 'banana']) -# For strings +# For text columns Query.not_contains("name", "Tom") ``` ```server-deno // For arrays Query.notContains("ingredients", ['apple', 'banana']) -// For strings +// For text columns Query.notContains("name", "Tom") ``` ```server-nodejs // For arrays Query.notContains("ingredients", ['apple', 'banana']) -// For strings +// For text columns Query.notContains("name", "Tom") ``` ```server-php // For arrays Query::notContains("ingredients", ['apple', 'banana']) -// For strings +// For text columns Query::notContains("name", "Tom") ``` ```server-dotnet // For arrays Query.NotContains("ingredients", new List { "apple", "banana" }) -// For strings +// For text columns Query.NotContains("name", "Tom") ``` ```server-go // For arrays query.NotContains("ingredients", []string{"apple", "banana"}) -// For strings +// For text columns query.NotContains("name", "Tom") ```server-dart // For arrays Query.notContains("ingredients", ['apple', 'banana']) -// For strings +// For text columns Query.notContains("name", "Tom") ``` ```server-swift // For arrays Query.notContains("ingredients", value: ['apple', 'banana']) -// For strings +// For text columns Query.notContains("name", value: "Tom") ``` ```server-kotlin // For arrays Query.notContains("ingredients", listOf("apple", "banana")) -// For strings +// For text columns Query.notContains("name", "Tom") ``` ```server-rust @@ -1357,24 +1369,24 @@ Query::not_contains("ingredients", Value::Array(vec![ Value::String("banana".to_string()), ])).to_string() -// For strings +// For text columns Query::not_contains("name", "Tom").to_string() ``` ```http # For arrays {"method":"notContains","column":"ingredients","values":["apple","banana"]} -# For strings +# For text columns {"method":"notContains","column":"name","values":["Tom"]} ``` {% /multicode %} ### Search {% #search %} -Searches string columns for provided keywords. Requires a [full-text index](/docs/products/databases/tables#indexes) on queried columns. The search string must be at least **3 characters** to perform a search. +Searches text columns for provided keywords. Requires a [full-text index](/docs/products/databases/tables#indexes) on queried columns. The search string must be at least **3 characters** to perform a search. {% info title="Searching values with hyphens" %} -The hyphen (`-`) is treated as a stop character by the underlying search engine. To search for exact values that contain hyphens (for example, ticket or SKU codes like `SWT-2621-44`), wrap the value in quotes inside the search string: `Query.search(attribute, '"SWT-2621-44"')`. +The hyphen (`-`) is treated as a stop character by the underlying search engine. To search for exact values that contain hyphens (for example, ticket or SKU codes like `SWT-2621-44`), wrap the value in quotes inside the search string: `Query.search(column, '"SWT-2621-44"')`. {% /info %} {% multicode %} @@ -1412,12 +1424,12 @@ Query::search("text", "key words").to_string() ### Not search {% #not-search %} -Returns rows if a string column does not match the full-text search +Returns rows if a text column does not match the full-text search query. Requires a [full-text index](/docs/products/databases/tables#indexes) on queried columns. The search string must be at least **3 characters** to perform a search. {% info title="Searching values with hyphens" %} -The hyphen (`-`) is treated as a stop character by the underlying search engine. To exclude exact values that contain hyphens (for example, ticket or SKU codes like `SWT-2621-44`), wrap the value in quotes inside the search string: `Query.notSearch(attribute, '"SWT-2621-44"')`. +The hyphen (`-`) is treated as a stop character by the underlying search engine. To exclude exact values that contain hyphens (for example, ticket or SKU codes like `SWT-2621-44`), wrap the value in quotes inside the search string: `Query.notSearch(column, '"SWT-2621-44"')`. {% /info %} {% multicode %} @@ -1621,7 +1633,7 @@ Query::orderDesc("column") Query.orderDesc("column") ``` ```server-go -query.OrderDesc("attribute") +query.OrderDesc("column") ``` ```server-rust Query::order_desc("column").to_string() @@ -1658,7 +1670,7 @@ Query::orderAsc("column") Query.orderAsc("column") ``` ```server-go -query.OrderAsc("attribute") +query.OrderAsc("column") ``` ```server-rust Query::order_asc("column").to_string() @@ -3072,4 +3084,3 @@ let rows = tables_db.list_rows( This example demonstrates how to combine `OR` and `AND` operations. The query uses `Query.or()` to match either condition: books under $20 OR magazines under $10. Each condition within the OR is composed of two AND conditions - one for the category and one for the price threshold. The database will return rows that match either of these combined conditions. - diff --git a/src/routes/docs/products/databases/quick-start/+page.markdoc b/src/routes/docs/products/databases/quick-start/+page.markdoc index 180e3b3cf1..78738351f7 100644 --- a/src/routes/docs/products/databases/quick-start/+page.markdoc +++ b/src/routes/docs/products/databases/quick-start/+page.markdoc @@ -13,7 +13,7 @@ Optionally, add a custom database ID. {% section #create-table step=2 title="Create table" %} Create a table and name it `My books`. Optionally, add a custom table ID. -Navigate to **Columns** and create columns by clicking **Create column** and select **String**. +Navigate to **Columns** and create columns by clicking **Create column** and select **Text**. Columns define the structure of your table's rows. Enter **Column key** and **Size**. For example, `title` and `100`. Navigate to **Settings** > **Permissions** and add a new role **Any**. @@ -325,7 +325,7 @@ try { {% /multicode %} {% info title="Automatic type generation" %} -You can automatically generate type definitions for your tables using the [Appwrite CLI type generation](/docs/products/databases/type-generation) feature. Run `appwrite types collection` to generate models for your collections. +You can automatically generate type definitions for your tables using the [Appwrite CLI type generation](/docs/products/databases/type-generation) feature. Run `appwrite types` to generate models for your tables. {% /info %} ### Model methods diff --git a/src/routes/docs/products/databases/relationships/+page.markdoc b/src/routes/docs/products/databases/relationships/+page.markdoc index dd89e2a19b..71d6f4adce 100644 --- a/src/routes/docs/products/databases/relationships/+page.markdoc +++ b/src/routes/docs/products/databases/relationships/+page.markdoc @@ -184,16 +184,16 @@ const client = new Client() const tablesDB = new TablesDB(client); -tablesDB.createRelationshipColumn( - "marvel", // Database ID - "movies", // Table ID - "reviews", // Related table ID - "oneToMany", // Relationship type - true, // Is two-way - "reviews", // Column key - "movie", // Two-way column key - "cascade" // On delete action -); +tablesDB.createRelationshipColumn({ + databaseId: "marvel", + tableId: "movies", + relatedTableId: "reviews", + type: "oneToMany", + twoWay: true, + key: "reviews", + twoWayKey: "movie", + onDelete: "cascade" +}); ``` diff --git a/src/routes/docs/products/databases/rows/+page.markdoc b/src/routes/docs/products/databases/rows/+page.markdoc index 7b2c8541e3..4d33317454 100644 --- a/src/routes/docs/products/databases/rows/+page.markdoc +++ b/src/routes/docs/products/databases/rows/+page.markdoc @@ -900,12 +900,12 @@ const client = new Client() const tablesDB = new TablesDB(client); -const promise = tablesDB.updateRow( - '', - '', - '', - { title: 'Updated Title' } -); +const promise = tablesDB.updateRow({ + databaseId: '', + tableId: '', + rowId: '', + data: { title: 'Updated Title' } +}); promise.then(function (response) { console.log(response); @@ -1020,12 +1020,12 @@ const client = new Client() const tablesDB = new TablesDB(client); -const promise = tablesDB.upsertRow( - '', - '', - ID.unique(), - {} -); +const promise = tablesDB.upsertRow({ + databaseId: '', + tableId: '', + rowId: ID.unique(), + data: {} +}); promise.then(function (response) { console.log(response); @@ -1336,7 +1336,7 @@ if let jsonString = jsonString, {% /tabs %} {% info title="Generate types automatically" %} -You can automatically generate model definitions for your tables using the [Appwrite CLI](/docs/products/databases/type-generation). Run `appwrite types collection` to generate types based on your database schema. +You can automatically generate model definitions for your tables using the [Appwrite CLI](/docs/products/databases/type-generation). Run `appwrite types` to generate types based on your database schema. {% /info %} # Permissions {% #permissions %} @@ -1630,4 +1630,3 @@ Perform create, update, and delete operations on multiple rows simultaneously. Set custom creation and update timestamps when migrating data or backdating records. {% /cards_item %} {% /cards %} - diff --git a/src/routes/docs/products/databases/tables/+page.markdoc b/src/routes/docs/products/databases/tables/+page.markdoc index 3e6b2fee4d..193adc2796 100644 --- a/src/routes/docs/products/databases/tables/+page.markdoc +++ b/src/routes/docs/products/databases/tables/+page.markdoc @@ -1568,7 +1568,7 @@ You can choose between the following types. | Column | Description | |--------------|------------------------------------------------------------------| -| `varchar` | String column. Fully indexable if size < 768. Maximum 16,383 characters. | +| `varchar` | Short text column. Fully indexable if size < 768. Maximum 16,383 characters. | | `text` | Text column. Prefix indexing only. Maximum 16,383 characters. | | `mediumtext` | Text column. Prefix indexing only. Maximum 4,194,303 characters. | | `longtext` | Text column. Prefix indexing only. Maximum 1,073,741,823 characters. | diff --git a/src/routes/docs/products/databases/timestamp-overrides/+page.markdoc b/src/routes/docs/products/databases/timestamp-overrides/+page.markdoc index 5c32f39389..22363521f2 100644 --- a/src/routes/docs/products/databases/timestamp-overrides/+page.markdoc +++ b/src/routes/docs/products/databases/timestamp-overrides/+page.markdoc @@ -1,24 +1,24 @@ --- layout: article title: Timestamp overrides -description: Set custom $createdAt and $updatedAt timestamps for your documents when using server SDKs. +description: Set custom $createdAt and $updatedAt timestamps for your rows when using server SDKs. --- -When creating or updating documents, Appwrite automatically sets `$createdAt` and `$updatedAt` timestamps. However, there are scenarios where you might need to set these timestamps manually, such as when migrating data from another system or backfilling historical records. +When creating or updating rows, Appwrite automatically sets `$createdAt` and `$updatedAt` timestamps. However, there are scenarios where you might need to set these timestamps manually, such as when migrating data from another system or backfilling historical records. {% info title="Server SDKs required" %} -To manually set `$createdAt` and `$updatedAt`, you must use a **server SDK** with an **API key**. These attributes can be passed inside the `data` parameter on any of the create, update, or upsert routes (single or bulk). +To manually set `$createdAt` and `$updatedAt`, you must use a **server SDK** with an **API key**. These columns can be passed inside the `data` parameter on any of the create, update, or upsert routes (single or bulk). {% /info %} # Setting custom timestamps {% #setting-custom-timestamps %} -You can override a document's timestamps by providing ISO 8601 strings (for example, `2025-08-10T12:34:56.000Z`) in the `data` payload. If these attributes are not provided, Appwrite will set them automatically. +You can override a row's timestamps by providing ISO 8601 strings (for example, `2025-08-10T12:34:56.000Z`) in the `data` payload. If these columns are not provided, Appwrite will set them automatically. -Custom timestamps work with all document operations: create, update, upsert, and their bulk variants. +Custom timestamps work with all row operations: create, update, upsert, and their bulk variants. -## Single document operations {% #single-document-operations %} +## Single row operations {% #single-row-operations %} -When working with individual documents, you can set custom timestamps during create, update, and upsert operations. +When working with individual rows, you can set custom timestamps during create, update, and upsert operations. ### Create with custom timestamps {% #create-custom %} @@ -31,39 +31,39 @@ const client = new sdk.Client() .setProject('') .setKey(''); -const databases = new sdk.Databases(client); +const tablesDB = new sdk.TablesDB(client); -await databases.createDocument( - '', - '', - sdk.ID.unique(), - { +await tablesDB.createRow({ + databaseId: '', + tableId: '', + rowId: sdk.ID.unique(), + data: { '$createdAt': new Date('2025-08-10T12:34:56.000Z').toISOString(), '$updatedAt': new Date('2025-08-10T12:34:56.000Z').toISOString(), - // ...your attributes + // ...your columns } -); +}); ``` ```server-php use Appwrite\Client; use Appwrite\ID; -use Appwrite\Services\Databases; +use Appwrite\Services\TablesDB; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') ->setProject('') ->setKey(''); -$databases = new Databases($client); +$tablesDB = new TablesDB($client); -$databases->createDocument( +$tablesDB->createRow( databaseId: '', - collectionId: '', - documentId: '', + tableId: '', + rowId: '', [ '$createdAt' => (new DateTime(''))->format(DATE_ATOM), '$updatedAt' => (new DateTime(''))->format(DATE_ATOM), - // ...your attributes + // ...your columns ] ); ``` @@ -76,7 +76,7 @@ let client = Client() .setProject("") .setKey("") -let databases = Databases(client) +let tablesDB = TablesDB(client) let isoFormatter = ISO8601DateFormatter() isoFormatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds] @@ -85,14 +85,14 @@ let createdAt = isoFormatter.string(from: customDate) let updatedAt = isoFormatter.string(from: customDate) do { - let created = try await databases.createDocument( + let created = try await tablesDB.createRow( databaseId: "", - collectionId: "", - documentId: "", + tableId: "", + rowId: "", data: [ "$createdAt": createdAt, "$updatedAt": updatedAt, - // ...your attributes + // ...your columns ] ) print("Created:", created) @@ -102,7 +102,7 @@ do { ``` ```server-python from appwrite.client import Client -from appwrite.services.databases import Databases +from appwrite.services.tables_db import TablesDB from appwrite.id import ID from datetime import datetime, timezone @@ -111,18 +111,18 @@ client.set_endpoint('https://.cloud.appwrite.io/v1') client.set_project('') client.set_key('') -databases = Databases(client) +tablesDB = TablesDB(client) iso = datetime(2025, 8, 10, 12, 34, 56, tzinfo=timezone.utc).isoformat() -databases.create_document( +tablesDB.create_row( database_id='', - collection_id='', - document_id=ID.unique(), + table_id='', + row_id=ID.unique(), data={ '$createdAt': iso, '$updatedAt': iso, - # ...your attributes + # ...your columns } ) ``` @@ -137,18 +137,18 @@ client = Client.new .set_project('') .set_key('') -databases = Databases.new(client) +tablesDB = TablesDB.new(client) custom_date = Time.parse('2025-08-10T12:34:56.000Z').iso8601 -databases.create_document( +tablesDB.create_row( database_id: '', - collection_id: '', - document_id: ID.unique(), + table_id: '', + row_id: ID.unique(), data: { '$createdAt' => custom_date, '$updatedAt' => custom_date, - # ...your attributes + # ...your columns } ) ``` @@ -162,19 +162,19 @@ Client client = new Client() .SetProject("") .SetKey(""); -Databases databases = new Databases(client); +TablesDB tablesDB = new TablesDB(client); string customDate = DateTimeOffset.Parse("2025-08-10T12:34:56.000Z").ToString("O"); -await databases.CreateDocument( +await tablesDB.CreateRow( databaseId: "", - collectionId: "", - documentId: ID.Unique(), + tableId: "", + rowId: ID.Unique(), data: new Dictionary { ["$createdAt"] = customDate, ["$updatedAt"] = customDate, - // ...your attributes + // ...your columns } ); ``` @@ -186,24 +186,24 @@ Client client = Client() .setProject('') .setKey(''); -Databases databases = Databases(client); +TablesDB tablesDB = TablesDB(client); String customDate = DateTime.parse('2025-08-10T12:34:56.000Z').toIso8601String(); -await databases.createDocument( +await tablesDB.createRow( databaseId: '', - collectionId: '', - documentId: ID.unique(), + tableId: '', + rowId: ID.unique(), data: { '\$createdAt': customDate, '\$updatedAt': customDate, - // ...your attributes + // ...your columns }, ); ``` ```rust use appwrite::Client; -use appwrite::services::databases::Databases; +use appwrite::services::tables_db::TablesDB; use appwrite::id::ID; use serde_json::json; @@ -214,16 +214,16 @@ async fn main() -> Result<(), Box> { .set_project("") .set_key(""); - let databases = Databases::new(&client); + let tablesDB = TablesDB::new(&client); - let result = databases.create_document( + let result = tablesDB.create_row( "", - "", + "", &ID::unique(), json!({ "$createdAt": "2025-08-10T12:34:56.000Z", "$updatedAt": "2025-08-10T12:34:56.000Z" - // ...your attributes + // ...your columns }), None, None, @@ -237,41 +237,41 @@ async fn main() -> Result<(), Box> { ### Update with custom timestamps {% #update-custom %} -When updating documents, you can also set a custom `$updatedAt` timestamp: +When updating rows, you can also set a custom `$updatedAt` timestamp: {% multicode %} ```server-nodejs -await databases.updateDocument( - '', - '', - '', - { +await tablesDB.updateRow({ + databaseId: '', + tableId: '', + rowId: '', + data: { '$updatedAt': new Date('2025-08-10T12:34:56.000Z').toISOString(), - // ...your attributes + // ...your columns } -); +}); ``` ```server-php -$databases->updateDocument( +$tablesDB->updateRow( databaseId: '', - collectionId: '', - documentId: '', + tableId: '', + rowId: '', [ '$updatedAt' => (new DateTime(''))->format(DATE_ATOM), - // ...your attributes + // ...your columns ] ); ``` ```server-python from datetime import datetime, timezone -databases.update_document( +tablesDB.update_row( database_id='', - collection_id='', - document_id='', + table_id='', + row_id='', data={ '$updatedAt': datetime(2025, 8, 10, 12, 34, 56, tzinfo=timezone.utc).isoformat(), - # ...your attributes + # ...your columns } ) ``` @@ -284,20 +284,20 @@ let client = Client() .setProject("") .setKey("") -let databases = Databases(client) +let tablesDB = TablesDB(client) let isoFormatter = ISO8601DateFormatter() isoFormatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds] let updatedAt = isoFormatter.string(from: isoFormatter.date(from: "") ?? Date()) do { - let updated = try await databases.updateDocument( + let updated = try await tablesDB.updateRow( databaseId: "", - collectionId: "", - documentId: "", + tableId: "", + rowId: "", data: [ "$updatedAt": updatedAt, - // ...your attributes + // ...your columns ] ) print("Updated:", updated) @@ -315,17 +315,17 @@ client = Client.new .set_project('') .set_key('') -databases = Databases.new(client) +tablesDB = TablesDB.new(client) custom_date = Time.parse('').iso8601 -databases.update_document( +tablesDB.update_row( database_id: '', - collection_id: '', - document_id: '', + table_id: '', + row_id: '', data: { '$updatedAt' => custom_date, - # ...your attributes + # ...your columns } ) ``` @@ -339,18 +339,18 @@ Client client = new Client() .SetProject("") .SetKey(""); -Databases databases = new Databases(client); +TablesDB tablesDB = new TablesDB(client); string customDate = DateTimeOffset.Parse("").ToString("O"); -await databases.UpdateDocument( +await tablesDB.UpdateRow( databaseId: "", - collectionId: "", - documentId: "", + tableId: "", + rowId: "", data: new Dictionary { ["$updatedAt"] = customDate, - // ...your attributes + // ...your columns } ); ``` @@ -362,23 +362,23 @@ Client client = Client() .setProject('') .setKey(''); -Databases databases = Databases(client); +TablesDB tablesDB = TablesDB(client); String customDate = DateTime.parse('').toIso8601String(); -await databases.updateDocument( +await tablesDB.updateRow( databaseId: '', - collectionId: '', - documentId: '', + tableId: '', + rowId: '', data: { '\$updatedAt': customDate, - // ...your attributes + // ...your columns }, ); ``` ```rust use appwrite::Client; -use appwrite::services::databases::Databases; +use appwrite::services::tables_db::TablesDB; use serde_json::json; #[tokio::main] @@ -388,15 +388,15 @@ async fn main() -> Result<(), Box> { .set_project("") .set_key(""); - let databases = Databases::new(&client); + let tablesDB = TablesDB::new(&client); - let result = databases.update_document( + let result = tablesDB.update_row( "", - "", - "", + "", + "", Some(json!({ "$updatedAt": "2025-08-10T12:34:56.000Z" - // ...your attributes + // ...your columns })), None, None, @@ -410,47 +410,47 @@ async fn main() -> Result<(), Box> { ## Bulk operations {% #bulk-operations %} -Custom timestamps also work with bulk operations, allowing you to set different timestamps for each document in the batch: +Custom timestamps also work with bulk operations, allowing you to set different timestamps for each row in the batch: ### Bulk create {% #bulk-create %} {% multicode %} ```server-nodejs -await databases.createDocuments( - '', - '', - [ +await tablesDB.createRows({ + databaseId: '', + tableId: '', + rows: [ { '$id': sdk.ID.unique(), '$createdAt': new Date('2024-01-01T00:00:00.000Z').toISOString(), '$updatedAt': new Date('2024-01-01T00:00:00.000Z').toISOString(), - // ...your attributes + // ...your columns }, { '$id': sdk.ID.unique(), '$createdAt': new Date('2024-02-01T00:00:00.000Z').toISOString(), '$updatedAt': new Date('2024-02-01T00:00:00.000Z').toISOString(), - // ...your attributes + // ...your columns } ] -); +}); ``` ```server-python -databases.create_documents( +tablesDB.create_rows( database_id='', - collection_id='', - documents=[ + table_id='', + rows=[ { '$id': ID.unique(), '$createdAt': datetime(2024, 1, 1, tzinfo=timezone.utc).isoformat(), '$updatedAt': datetime(2024, 1, 1, tzinfo=timezone.utc).isoformat(), - # ...your attributes + # ...your columns }, { '$id': ID.unique(), '$createdAt': datetime(2024, 2, 1, tzinfo=timezone.utc).isoformat(), '$updatedAt': datetime(2024, 2, 1, tzinfo=timezone.utc).isoformat(), - # ...your attributes + # ...your columns } ] ) @@ -458,30 +458,30 @@ databases.create_documents( ```server-php use Appwrite\Client; use Appwrite\ID; -use Appwrite\Services\Databases; +use Appwrite\Services\TablesDB; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') ->setProject('') ->setKey(''); -$databases = new Databases($client); +$tablesDB = new TablesDB($client); -$databases->createDocuments( +$tablesDB->createRows( databaseId: '', - collectionId: '', - documents: [ + tableId: '', + rows: [ [ '$id' => ID::unique(), '$createdAt' => (new DateTime(''))->format(DATE_ATOM), '$updatedAt' => (new DateTime(''))->format(DATE_ATOM), - // ...your attributes + // ...your columns ], [ '$id' => ID::unique(), '$createdAt' => (new DateTime(''))->format(DATE_ATOM), '$updatedAt' => (new DateTime(''))->format(DATE_ATOM), - // ...your attributes + // ...your columns ], ] ); @@ -495,7 +495,7 @@ let client = Client() .setProject("") .setKey("") -let databases = Databases(client) +let tablesDB = TablesDB(client) let isoFormatter = ISO8601DateFormatter() isoFormatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds] @@ -504,21 +504,21 @@ let first = isoFormatter.string(from: isoFormatter.date(from: "") ? let second = isoFormatter.string(from: isoFormatter.date(from: "") ?? Date()) do { - let bulkCreated = try await databases.createDocuments( + let bulkCreated = try await tablesDB.createRows( databaseId: "", - collectionId: "", - documents: [ + tableId: "", + rows: [ [ "$id": ID.unique(), "$createdAt": first, "$updatedAt": first, - // ...your attributes + // ...your columns ], [ "$id": ID.unique(), "$createdAt": second, "$updatedAt": second, - // ...your attributes + // ...your columns ] ] ) @@ -537,26 +537,26 @@ client = Client.new .set_project('') .set_key('') -databases = Databases.new(client) +tablesDB = TablesDB.new(client) first = Time.parse('').iso8601 second = Time.parse('').iso8601 -databases.create_documents( +tablesDB.create_rows( database_id: '', - collection_id: '', - documents: [ + table_id: '', + rows: [ { '$id' => ID.unique(), '$createdAt' => first, '$updatedAt' => first, - # ...your attributes + # ...your columns }, { '$id' => ID.unique(), '$createdAt' => second, '$updatedAt' => second, - # ...your attributes + # ...your columns } ] ) @@ -571,29 +571,29 @@ Client client = new Client() .SetProject("") .SetKey(""); -Databases databases = new Databases(client); +TablesDB tablesDB = new TablesDB(client); string first = DateTimeOffset.Parse("").ToString("O"); string second = DateTimeOffset.Parse("").ToString("O"); -await databases.CreateDocuments( +await tablesDB.CreateRows( databaseId: "", - collectionId: "", - documents: new List + tableId: "", + rows: new List { new Dictionary { ["$id"] = ID.Unique(), ["$createdAt"] = first, ["$updatedAt"] = first, - // ...your attributes + // ...your columns }, new Dictionary { ["$id"] = ID.Unique(), ["$createdAt"] = second, ["$updatedAt"] = second, - // ...your attributes + // ...your columns } } ); @@ -606,33 +606,33 @@ Client client = Client() .setProject('') .setKey(''); -Databases databases = Databases(client); +TablesDB tablesDB = TablesDB(client); String first = DateTime.parse('').toIso8601String(); String second = DateTime.parse('').toIso8601String(); -await databases.createDocuments( +await tablesDB.createRows( databaseId: '', - collectionId: '', - documents: [ + tableId: '', + rows: [ { '\$id': ID.unique(), '\$createdAt': first, '\$updatedAt': first, - // ...your attributes + // ...your columns }, { '\$id': ID.unique(), '\$createdAt': second, '\$updatedAt': second, - // ...your attributes + // ...your columns } ], ); ``` ```rust use appwrite::Client; -use appwrite::services::databases::Databases; +use appwrite::services::tables_db::TablesDB; use appwrite::id::ID; use serde_json::json; @@ -643,23 +643,23 @@ async fn main() -> Result<(), Box> { .set_project("") .set_key(""); - let databases = Databases::new(&client); + let tablesDB = TablesDB::new(&client); - let result = databases.create_documents( + let result = tablesDB.create_rows( "", - "", + "", vec![ json!({ "$id": ID::unique(), "$createdAt": "2024-01-01T00:00:00.000Z", "$updatedAt": "2024-01-01T00:00:00.000Z" - // ...your attributes + // ...your columns }), json!({ "$id": ID::unique(), "$createdAt": "2024-02-01T00:00:00.000Z", "$updatedAt": "2024-02-01T00:00:00.000Z" - // ...your attributes + // ...your columns }), ], None, @@ -675,29 +675,29 @@ async fn main() -> Result<(), Box> { {% multicode %} ```server-nodejs -await databases.upsertDocuments( - '', - '', - [ +await tablesDB.upsertRows({ + databaseId: '', + tableId: '', + rows: [ { - '$id': '', + '$id': '', '$createdAt': new Date('2024-01-01T00:00:00.000Z').toISOString(), '$updatedAt': new Date('2025-01-01T00:00:00.000Z').toISOString(), - // ...your attributes + // ...your columns } ] -); +}); ``` ```server-python -databases.upsert_documents( +tablesDB.upsert_rows( database_id='', - collection_id='', - documents=[ + table_id='', + rows=[ { - '$id': '', + '$id': '', '$createdAt': datetime(2024, 1, 1, tzinfo=timezone.utc).isoformat(), '$updatedAt': datetime(2025, 1, 1, tzinfo=timezone.utc).isoformat(), - # ...your attributes + # ...your columns } ] ) @@ -705,24 +705,24 @@ databases.upsert_documents( ```server-php use Appwrite\Client; use Appwrite\ID; -use Appwrite\Services\Databases; +use Appwrite\Services\TablesDB; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') ->setProject('') ->setKey(''); -$databases = new Databases($client); +$tablesDB = new TablesDB($client); -$databases->upsertDocuments( +$tablesDB->upsertRows( databaseId: '', - collectionId: '', - documents: [ + tableId: '', + rows: [ [ - '$id' => '', + '$id' => '', '$createdAt' => (new DateTime(''))->format(DATE_ATOM), '$updatedAt' => (new DateTime(''))->format(DATE_ATOM), - // ...your attributes + // ...your columns ], ] ); @@ -736,7 +736,7 @@ let client = Client() .setProject("") .setKey("") -let databases = Databases(client) +let tablesDB = TablesDB(client) let isoFormatter = ISO8601DateFormatter() isoFormatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds] @@ -744,15 +744,15 @@ let createdAt = isoFormatter.string(from: isoFormatter.date(from: " let updatedAt = isoFormatter.string(from: isoFormatter.date(from: "") ?? Date()) do { - let bulkUpserted = try await databases.upsertDocuments( + let bulkUpserted = try await tablesDB.upsertRows( databaseId: "", - collectionId: "", - documents: [ + tableId: "", + rows: [ [ - "$id": "", + "$id": "", "$createdAt": createdAt, "$updatedAt": updatedAt, - // ...your attributes + // ...your columns ] ] ) @@ -772,19 +772,19 @@ client = Client.new .set_project('') .set_key('') -databases = Databases.new(client) +tablesDB = TablesDB.new(client) custom_date = Time.parse('').iso8601 -databases.upsert_documents( +tablesDB.upsert_rows( database_id: '', - collection_id: '', - documents: [ + table_id: '', + rows: [ { - '$id' => '', + '$id' => '', '$createdAt' => custom_date, '$updatedAt' => custom_date, - # ...your attributes + # ...your columns } ] ) @@ -799,22 +799,22 @@ Client client = new Client() .SetProject("") .SetKey(""); -Databases databases = new Databases(client); +TablesDB tablesDB = new TablesDB(client); string createdAt = DateTimeOffset.Parse("").ToString("O"); string updatedAt = DateTimeOffset.Parse("").ToString("O"); -await databases.UpsertDocuments( +await tablesDB.UpsertRows( databaseId: "", - collectionId: "", - documents: new List + tableId: "", + rows: new List { new Dictionary { - ["$id"] = "", + ["$id"] = "", ["$createdAt"] = createdAt, ["$updatedAt"] = updatedAt, - // ...your attributes + // ...your columns } } ); @@ -827,27 +827,27 @@ Client client = Client() .setProject('') .setKey(''); -Databases databases = Databases(client); +TablesDB tablesDB = TablesDB(client); String createdAt = DateTime.parse('').toIso8601String(); String updatedAt = DateTime.parse('').toIso8601String(); -await databases.upsertDocuments( +await tablesDB.upsertRows( databaseId: '', - collectionId: '', - documents: [ + tableId: '', + rows: [ { - '\$id': '', + '\$id': '', '\$createdAt': createdAt, '\$updatedAt': updatedAt, - // ...your attributes + // ...your columns } ], ); ``` ```rust use appwrite::Client; -use appwrite::services::databases::Databases; +use appwrite::services::tables_db::TablesDB; use serde_json::json; #[tokio::main] @@ -857,17 +857,17 @@ async fn main() -> Result<(), Box> { .set_project("") .set_key(""); - let databases = Databases::new(&client); + let tablesDB = TablesDB::new(&client); - let result = databases.upsert_documents( + let result = tablesDB.upsert_rows( "", - "", + "", vec![ json!({ - "$id": "", + "$id": "", "$createdAt": "2024-01-01T00:00:00.000Z", "$updatedAt": "2025-01-01T00:00:00.000Z" - // ...your attributes + // ...your columns }), ], None, @@ -889,23 +889,23 @@ creation and modification times: {% multicode %} ```server-nodejs -await databases.createDocument( - '', - 'blog_posts', - sdk.ID.unique(), - { +await tablesDB.createRow({ + databaseId: '', + tableId: 'blog_posts', + rowId: sdk.ID.unique(), + data: { '$createdAt': '', '$updatedAt': '', title: '', content: '<CONTENT>' } -) +}) ``` ```server-php -$databases->createDocument( +$tablesDB->createRow( databaseId: '<DATABASE_ID>', - collectionId: 'blog_posts', - documentId: ID::unique(), + tableId: 'blog_posts', + rowId: ID::unique(), [ '$createdAt' => '<ORIGINAL_CREATED_AT_ISO>', '$updatedAt' => '<LAST_MODIFIED_ISO>', @@ -915,10 +915,10 @@ $databases->createDocument( ); ``` ```server-swift -let _ = try await databases.createDocument( +let _ = try await tablesDB.createRow( databaseId: "<DATABASE_ID>", - collectionId: "blog_posts", - documentId: ID.unique(), + tableId: "blog_posts", + rowId: ID.unique(), data: [ "$createdAt": "<ORIGINAL_CREATED_AT_ISO>", "$updatedAt": "<LAST_MODIFIED_ISO>", @@ -928,10 +928,10 @@ let _ = try await databases.createDocument( ) ``` ```server-python -databases.create_document( +tablesDB.create_row( database_id='<DATABASE_ID>', - collection_id='blog_posts', - document_id=ID.unique(), + table_id='blog_posts', + row_id=ID.unique(), data={ '$createdAt': '<ORIGINAL_CREATED_AT_ISO>', '$updatedAt': '<LAST_MODIFIED_ISO>', @@ -941,10 +941,10 @@ databases.create_document( ) ``` ```server-ruby -databases.create_document( +tablesDB.create_row( database_id: '<DATABASE_ID>', - collection_id: 'blog_posts', - document_id: ID.unique(), + table_id: 'blog_posts', + row_id: ID.unique(), data: { '$createdAt' => '<ORIGINAL_CREATED_AT_ISO>', '$updatedAt' => '<LAST_MODIFIED_ISO>', @@ -954,10 +954,10 @@ databases.create_document( ) ``` ```server-dotnet -await databases.CreateDocument( +await tablesDB.CreateRow( databaseId: "<DATABASE_ID>", - collectionId: "blog_posts", - documentId: ID.Unique(), + tableId: "blog_posts", + rowId: ID.Unique(), data: new Dictionary<string, object> { ["$createdAt"] = "<ORIGINAL_CREATED_AT_ISO>", @@ -968,10 +968,10 @@ await databases.CreateDocument( ); ``` ```server-dart -await databases.createDocument( +await tablesDB.createRow( databaseId: '<DATABASE_ID>', - collectionId: 'blog_posts', - documentId: ID.unique(), + tableId: 'blog_posts', + rowId: ID.unique(), data: { '\$createdAt': '<ORIGINAL_CREATED_AT_ISO>', '\$updatedAt': '<LAST_MODIFIED_ISO>', @@ -982,7 +982,7 @@ await databases.createDocument( ``` ```rust use appwrite::Client; -use appwrite::services::databases::Databases; +use appwrite::services::tables_db::TablesDB; use appwrite::id::ID; use serde_json::json; @@ -993,9 +993,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { .set_project("<PROJECT_ID>") .set_key("<API_KEY>"); - let databases = Databases::new(&client); + let tablesDB = TablesDB::new(&client); - let result = databases.create_document( + let result = tablesDB.create_row( "<DATABASE_ID>", "blog_posts", &ID::unique(), @@ -1020,23 +1020,23 @@ For historical data entry or when creating records that represent past events: {% multicode %} ```server-nodejs -await databases.createDocument( - '<DATABASE_ID>', - 'transactions', - sdk.ID.unique(), - { +await tablesDB.createRow({ + databaseId: '<DATABASE_ID>', + tableId: 'transactions', + rowId: sdk.ID.unique(), + data: { '$createdAt': '2023-12-31T23:59:59.000Z', '$updatedAt': '2023-12-31T23:59:59.000Z', amount: 1000, type: 'year-end-bonus' } -) +}) ``` ```server-php -$databases->createDocument( +$tablesDB->createRow( databaseId: '<DATABASE_ID>', - collectionId: 'transactions', - documentId: ID::unique(), + tableId: 'transactions', + rowId: ID::unique(), [ '$createdAt' => '2023-12-31T23:59:59.000Z', '$updatedAt' => '2023-12-31T23:59:59.000Z', @@ -1046,10 +1046,10 @@ $databases->createDocument( ); ``` ```server-swift -let _ = try await databases.createDocument( +let _ = try await tablesDB.createRow( databaseId: "<DATABASE_ID>", - collectionId: "transactions", - documentId: ID.unique(), + tableId: "transactions", + rowId: ID.unique(), data: [ "$createdAt": "2023-12-31T23:59:59.000Z", "$updatedAt": "2023-12-31T23:59:59.000Z", @@ -1059,10 +1059,10 @@ let _ = try await databases.createDocument( ) ``` ```server-python -databases.create_document( +tablesDB.create_row( database_id='<DATABASE_ID>', - collection_id='transactions', - document_id=ID.unique(), + table_id='transactions', + row_id=ID.unique(), data={ '$createdAt': '2023-12-31T23:59:59.000Z', '$updatedAt': '2023-12-31T23:59:59.000Z', @@ -1072,10 +1072,10 @@ databases.create_document( ) ``` ```server-ruby -databases.create_document( +tablesDB.create_row( database_id: '<DATABASE_ID>', - collection_id: 'transactions', - document_id: ID.unique(), + table_id: 'transactions', + row_id: ID.unique(), data: { '$createdAt' => '2023-12-31T23:59:59.000Z', '$updatedAt' => '2023-12-31T23:59:59.000Z', @@ -1085,10 +1085,10 @@ databases.create_document( ) ``` ```server-dotnet -await databases.CreateDocument( +await tablesDB.CreateRow( databaseId: "<DATABASE_ID>", - collectionId: "transactions", - documentId: ID.Unique(), + tableId: "transactions", + rowId: ID.Unique(), data: new Dictionary<string, object> { ["$createdAt"] = "2023-12-31T23:59:59.000Z", @@ -1099,10 +1099,10 @@ await databases.CreateDocument( ); ``` ```server-dart -await databases.createDocument( +await tablesDB.createRow( databaseId: '<DATABASE_ID>', - collectionId: 'transactions', - documentId: ID.unique(), + tableId: 'transactions', + rowId: ID.unique(), data: { '\$createdAt': '2023-12-31T23:59:59.000Z', '\$updatedAt': '2023-12-31T23:59:59.000Z', @@ -1113,7 +1113,7 @@ await databases.createDocument( ``` ```rust use appwrite::Client; -use appwrite::services::databases::Databases; +use appwrite::services::tables_db::TablesDB; use appwrite::id::ID; use serde_json::json; @@ -1124,9 +1124,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { .set_project("<PROJECT_ID>") .set_key("<API_KEY>"); - let databases = Databases::new(&client); + let tablesDB = TablesDB::new(&client); - let result = databases.create_document( + let result = tablesDB.create_row( "<DATABASE_ID>", "transactions", &ID::unique(), @@ -1151,21 +1151,21 @@ When synchronizing data between systems while maintaining timestamp consistency: {% multicode %} ```server-nodejs -await databases.upsertDocument( - '<DATABASE_ID>', - 'users', - '<DOCUMENT_ID_OR_NEW_ID>', - { +await tablesDB.upsertRow({ + databaseId: '<DATABASE_ID>', + tableId: 'users', + rowId: '<ROW_ID_OR_NEW_ID>', + data: { '$updatedAt': '<EXTERNAL_LAST_MODIFIED_ISO>', profile: '<PROFILE_DATA>' } -) +}) ``` ```server-php -$databases->upsertDocument( +$tablesDB->upsertRow( databaseId: '<DATABASE_ID>', - collectionId: 'users', - documentId: '<DOCUMENT_ID_OR_NEW_ID>', + tableId: 'users', + rowId: '<ROW_ID_OR_NEW_ID>', [ '$updatedAt' => '<EXTERNAL_LAST_MODIFIED_ISO>', 'profile' => '<PROFILE_DATA>' @@ -1173,10 +1173,10 @@ $databases->upsertDocument( ); ``` ```server-swift -let _ = try await databases.upsertDocument( +let _ = try await tablesDB.upsertRow( databaseId: "<DATABASE_ID>", - collectionId: "users", - documentId: "<DOCUMENT_ID_OR_NEW_ID>", + tableId: "users", + rowId: "<ROW_ID_OR_NEW_ID>", data: [ "$updatedAt": "<EXTERNAL_LAST_MODIFIED_ISO>", "profile": "<PROFILE_DATA>" @@ -1184,10 +1184,10 @@ let _ = try await databases.upsertDocument( ) ``` ```server-python -databases.upsert_document( +tablesDB.upsert_row( database_id='<DATABASE_ID>', - collection_id='users', - document_id='<DOCUMENT_ID_OR_NEW_ID>', + table_id='users', + row_id='<ROW_ID_OR_NEW_ID>', data={ '$updatedAt': '<EXTERNAL_LAST_MODIFIED_ISO>', 'profile': '<PROFILE_DATA>' @@ -1195,10 +1195,10 @@ databases.upsert_document( ) ``` ```server-ruby -databases.upsert_document( +tablesDB.upsert_row( database_id: '<DATABASE_ID>', - collection_id: 'users', - document_id: '<DOCUMENT_ID_OR_NEW_ID>', + table_id: 'users', + row_id: '<ROW_ID_OR_NEW_ID>', data: { '$updatedAt' => '<EXTERNAL_LAST_MODIFIED_ISO>', 'profile' => '<PROFILE_DATA>' @@ -1206,10 +1206,10 @@ databases.upsert_document( ) ``` ```server-dotnet -await databases.UpsertDocument( +await tablesDB.UpsertRow( databaseId: "<DATABASE_ID>", - collectionId: "users", - documentId: "<DOCUMENT_ID_OR_NEW_ID>", + tableId: "users", + rowId: "<ROW_ID_OR_NEW_ID>", data: new Dictionary<string, object> { ["$updatedAt"] = "<EXTERNAL_LAST_MODIFIED_ISO>", @@ -1218,10 +1218,10 @@ await databases.UpsertDocument( ); ``` ```server-dart -await databases.upsertDocument( +await tablesDB.upsertRow( databaseId: '<DATABASE_ID>', - collectionId: 'users', - documentId: '<DOCUMENT_ID_OR_NEW_ID>', + tableId: 'users', + rowId: '<ROW_ID_OR_NEW_ID>', data: { '\$updatedAt': '<EXTERNAL_LAST_MODIFIED_ISO>', 'profile': '<PROFILE_DATA>' @@ -1230,7 +1230,7 @@ await databases.upsertDocument( ``` ```rust use appwrite::Client; -use appwrite::services::databases::Databases; +use appwrite::services::tables_db::TablesDB; use serde_json::json; #[tokio::main] @@ -1240,12 +1240,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { .set_project("<PROJECT_ID>") .set_key("<API_KEY>"); - let databases = Databases::new(&client); + let tablesDB = TablesDB::new(&client); - let result = databases.upsert_document( + let result = tablesDB.upsert_row( "<DATABASE_ID>", "users", - "<DOCUMENT_ID_OR_NEW_ID>", + "<ROW_ID_OR_NEW_ID>", Some(json!({ "$updatedAt": "<EXTERNAL_LAST_MODIFIED_ISO>", "profile": "<PROFILE_DATA>" @@ -1262,6 +1262,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { {% info title="Timestamp format and usage" %} - Values must be valid ISO 8601 date-time strings (UTC recommended). Using `toISOString()` (JavaScript) or `datetime.isoformat()` (Python) is a good default. -- You can set either or both attributes as needed. If omitted, Appwrite sets them automatically. +- You can set either or both columns as needed. If omitted, Appwrite sets them automatically. {% /info %} diff --git a/src/routes/docs/products/databases/transactions/+page.markdoc b/src/routes/docs/products/databases/transactions/+page.markdoc index ccba413fea..2e18977a87 100644 --- a/src/routes/docs/products/databases/transactions/+page.markdoc +++ b/src/routes/docs/products/databases/transactions/+page.markdoc @@ -660,8 +660,8 @@ Use the `createOperations` method to stage multiple operations across databases { "action": "create|update|upsert|increment|decrement|delete|bulkCreate|bulkUpdate|bulkUpsert|bulkDelete", "databaseId": "<DATABASE_ID>", - "tableId|collectionId": "<TABLE_ID|COLLECTION_ID>", - "rowId|documentId": "<ROW_ID|DOCUMENT_ID>", + "tableId": "<TABLE_ID>", + "rowId": "<ROW_ID>", "data": {} } ] diff --git a/src/routes/docs/products/functions/develop/+page.markdoc b/src/routes/docs/products/functions/develop/+page.markdoc index 4c43dfaff8..14fedb31ed 100644 --- a/src/routes/docs/products/functions/develop/+page.markdoc +++ b/src/routes/docs/products/functions/develop/+page.markdoc @@ -1697,12 +1697,12 @@ export default function ({req, res, error}: any){ const tablesDB = new TablesDB(client); try { - tablesDB.createRow( - "<DATABASE_ID>", - "<TABLE_ID>", - ID.unique(), - {} - ); + tablesDB.createRow({ + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: ID.unique(), + data: {} + }); } catch (e) { error("Failed to create row: " + e.message); return res.text("Failed to create row"); @@ -2085,7 +2085,7 @@ def main(context) tablesDB = Appwrite::TablesDB.new(client) begin - tablesDB.create_row('<DATABASE_ID>', '<TABLE_ID>', Appwrite::ID.unique(), {}) + tablesDB.create_row(database_id: '<DATABASE_ID>', table_id: '<TABLE_ID>', row_id: Appwrite::ID.unique(), data: {}) rescue Appwrite::Exception => e context.error("Failed to create row: " + e.message) return context.response.text("Failed to create row") @@ -2110,12 +2110,12 @@ export default function ({req, res, error}: any){ const tablesDB = new TablesDB(client); try { - tablesDB.createRow( - "<DATABASE_ID>", - "<TABLE_ID>", - ID.unique(), - {} - ); + tablesDB.createRow({ + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: ID.unique(), + data: {} + }); } catch (e) { error("Failed to create row: " + e.message) return res.text("Failed to create row"); diff --git a/src/routes/docs/products/functions/examples/+page.markdoc b/src/routes/docs/products/functions/examples/+page.markdoc index ad0008d05f..7bf4a6239d 100644 --- a/src/routes/docs/products/functions/examples/+page.markdoc +++ b/src/routes/docs/products/functions/examples/+page.markdoc @@ -309,16 +309,16 @@ Create a Topics table with the following columns: | Name | Type | Description | |---------------|--------|----------------------------------| -| `title` | string | The name of the topic | -| `description` | string | Long form description of the topic| +| `title` | Varchar | The name of the topic | +| `description` | Text | Long form description of the topic| Create a Votes table with the following columns: | Name | Type | Description | |---------------|--------|------------------------------------------| -| `userId` | string | The ID of the user who cast the vote | -| `topicId` | string | The ID of the topic that was voted on | -| `vote` | string | The vote cast by the user. Must be either "yes" or "no" | +| `userId` | Varchar | The ID of the user who cast the vote | +| `topicId` | Varchar | The ID of the topic that was voted on | +| `vote` | Varchar | The vote cast by the user. Must be either "yes" or "no" | ## Code @@ -349,8 +349,8 @@ export default async function ({ req, res }) { databaseId: '<DATABASE_ID>', tableId: '<VOTES_TABLE_ID>', queries: [ - Query.equals('userId', vote.userId), - Query.equals('topicId', vote.topicId) + Query.equal('userId', vote.userId), + Query.equal('topicId', vote.topicId) ] }); @@ -376,6 +376,7 @@ export default async function ({ req, res }) { from appwrite.client import Client from appwrite.services.tables_db import TablesDB from appwrite.query import Query +from appwrite.id import ID import os def main(context): @@ -397,9 +398,9 @@ def main(context): tablesDB = TablesDB(client) - existing_votes = tablesDB.list_rows('<VOTES_TABLE_ID>', [ - Query.equals('userId', vote['userId']), - Query.equals('topicId', vote['topicId']) + existing_votes = tablesDB.list_rows(database_id='<DATABASE_ID>', table_id='<VOTES_TABLE_ID>', queries=[ + Query.equal('userId', vote['userId']), + Query.equal('topicId', vote['topicId']) ]) if existing_votes['total'] > 0: @@ -408,11 +409,16 @@ def main(context): 'message': 'You have already voted on this topic.' }, 400) - vote_row = database.create_row('<VOTES_TABLE_ID>', { - 'userId': vote['userId'], - 'topicId': vote['topicId'], - 'vote': vote['vote'], - }) + vote_row = tablesDB.create_row( + database_id='<DATABASE_ID>', + table_id='<VOTES_TABLE_ID>', + row_id=ID.unique(), + data={ + 'userId': vote['userId'], + 'topicId': vote['topicId'], + 'vote': vote['vote'], + } + ) return context.res.json({'ok': True, 'message': 'Vote cast.', 'vote': vote_row}) ``` @@ -423,7 +429,8 @@ require(__DIR__ . '/../vendor/autoload.php'); use Appwrite\Client; use Appwrite\Exception; -use Appwrite\Services\Database; +use Appwrite\Services\TablesDB; +use Appwrite\ID; use Appwrite\Query; return function ($context) { @@ -445,10 +452,14 @@ return function ($context) { $tablesDB = new TablesDB($client); - $existingVotes = $database->listRows('<VOTES_TABLE_ID>', [ - Query->equal('userId', $vote['userId']), - Query->equal('topicId', $vote['topicId']) - ]); + $existingVotes = $tablesDB->listRows( + databaseId: '<DATABASE_ID>', + tableId: '<VOTES_TABLE_ID>', + queries: [ + Query::equal('userId', $vote['userId']), + Query::equal('topicId', $vote['topicId']) + ] + ); if ($existingVotes['total'] > 0) { return $context->res->json([ @@ -457,16 +468,21 @@ return function ($context) { ], 400); } - $voteDocument = $database->createRow('<VOTES_TABLE_ID>', [ - 'userId' => $vote['userId'], - 'topicId' => $vote['topicId'], - 'vote' => $vote['vote'], - ]); + $voteRow = $tablesDB->createRow( + databaseId: '<DATABASE_ID>', + tableId: '<VOTES_TABLE_ID>', + rowId: ID::unique(), + data: [ + 'userId' => $vote['userId'], + 'topicId' => $vote['topicId'], + 'vote' => $vote['vote'], + ] + ); return $context->res->json([ 'ok' => true, 'message' => 'Vote cast.', - 'vote' => $voteDocument + 'vote' => $voteRow ]); }; ``` @@ -493,10 +509,14 @@ Future main(final context) async { final tablesDB = TablesDB(client); - final existingVotes = await tablesDB.listRows('<VOTES_TABLE_ID>', [ - Query.equals('userId', vote['userId']), - Query.equals('topicId', vote['topicId']) - ]); + final existingVotes = await tablesDB.listRows( + databaseId: '<DATABASE_ID>', + tableId: '<VOTES_TABLE_ID>', + queries: [ + Query.equal('userId', vote['userId']), + Query.equal('topicId', vote['topicId']) + ] + ); if (existingVotes['total'] > 0) { return context.res.json({ @@ -505,16 +525,21 @@ Future main(final context) async { }, 400); } - final voteDocument = await database.createRow('<VOTES_TABLE_ID>', { - 'userId': vote['userId'], - 'topicId': vote['topicId'], - 'vote': vote['vote'], - }); + final voteRow = await tablesDB.createRow( + databaseId: '<DATABASE_ID>', + tableId: '<VOTES_TABLE_ID>', + rowId: ID.unique(), + data: { + 'userId': vote['userId'], + 'topicId': vote['topicId'], + 'vote': vote['vote'], + } + ); return context.res.json({ 'ok': true, 'message': 'Vote cast.', - 'vote': voteDocument + 'vote': voteRow }); } ``` @@ -540,10 +565,14 @@ def main(context) tablesDB = Appwrite::TablesDB.new(client) - existing_votes = tablesDB.list_rows('<DATABASE_ID>', '<VOTES_TABLE_ID>', [ - Appwrite::Query.equal('userId', vote['userId']), - Appwrite::Query.equal('topicId', vote['topicId']) - ]) + existing_votes = tablesDB.list_rows( + database_id: '<DATABASE_ID>', + table_id: '<VOTES_TABLE_ID>', + queries: [ + Appwrite::Query.equal('userId', vote['userId']), + Appwrite::Query.equal('topicId', vote['topicId']) + ] + ) if existing_votes['total'] > 0 return context.res.json({ @@ -552,11 +581,16 @@ def main(context) }, 400) end - vote_row = database.create_row('<VOTES_TABLE_ID>', { - 'userId': vote['userId'], - 'topicId': vote['topicId'], - 'vote': vote['vote'], - }) + vote_row = tablesDB.create_row( + database_id: '<DATABASE_ID>', + table_id: '<VOTES_TABLE_ID>', + row_id: Appwrite::ID.unique(), + data: { + 'userId' => vote['userId'], + 'topicId' => vote['topicId'], + 'vote' => vote['vote'], + } + ) return context.res.json({ 'ok': true, @@ -681,9 +715,9 @@ Create a Messages table with the following columns: | Name | Type | Description | |------------|--------|----------------------------------| -| `name` | string | The name of the message author | -| `email` | string | The email of the message author | -| `content` | string | The content of the message | +| `name` | Varchar | The name of the message author | +| `email` | Email | The email of the message author | +| `content` | Text | The content of the message | ## Code @@ -788,7 +822,7 @@ def main(context): ) tablesDB = TablesDB(client) - row = tablesDB.create_row('<DATABASE_ID>', '<MESSAGES_TABLE_ID>', ID.unique(), message) + row = tablesDB.create_row(database_id='<DATABASE_ID>', table_id='<MESSAGES_TABLE_ID>', row_id=ID.unique(), data=message) return context.res.text("Message sent") @@ -803,6 +837,7 @@ require(__DIR__ . '/../vendor/autoload.php'); use Appwrite\Client; use Appwrite\Exception; use Appwrite\Services\TablesDB; +use Appwrite\ID; $html = '<!doctype html> <html lang="en"> @@ -842,7 +877,12 @@ return function ($context) { ->setKey($context->req->headers['x-appwrite-key']); $tablesDB = new TablesDB($client); - $row = $tablesDB->createRow('<DATABASE_ID>', '<MESSAGES_TABLE_ID>', ID::unique(), $message); + $row = $tablesDB->createRow( + databaseId: '<DATABASE_ID>', + tableId: '<MESSAGES_TABLE_ID>', + rowId: ID::unique(), + data: $message + ); return $context->res->text("Message sent"); } @@ -891,7 +931,7 @@ def main(context) .set_key(context.req.headers['x-appwrite-key']) tablesDB = Appwrite::TablesDB.new(client) - row = tablesDB.create_row('<DATABASE_ID>', '<MESSAGES_TABLE_ID>', ID.unique(), message) + row = tablesDB.create_row(database_id: '<DATABASE_ID>', table_id: '<MESSAGES_TABLE_ID>', row_id: Appwrite::ID.unique(), data: message) return context.res.text("Message sent") end @@ -903,6 +943,7 @@ end ```dart import 'dart:async'; import 'package:dart_appwrite/dart_appwrite.dart'; +import 'dart:io'; Future main(final context) async { final html = '''<!doctype html> @@ -941,7 +982,12 @@ Future main(final context) async { .setKey(context.req.headers['x-appwrite-key']); final tablesDB = TablesDB(client); - final row = await tablesDB.createRow('<DATABASE_ID>', '<MESSAGES_TABLE_ID>', ID.unique(), message); + final row = await tablesDB.createRow( + databaseId: '<DATABASE_ID>', + tableId: '<MESSAGES_TABLE_ID>', + rowId: ID.unique(), + data: message + ); return context.res.text("Message sent"); } diff --git a/src/routes/docs/products/functions/execute/+page.markdoc b/src/routes/docs/products/functions/execute/+page.markdoc index 326c5be60c..ed74af2275 100644 --- a/src/routes/docs/products/functions/execute/+page.markdoc +++ b/src/routes/docs/products/functions/execute/+page.markdoc @@ -88,6 +88,7 @@ const client = new Client(); const functions = new Functions(client); client + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<PROJECT_ID>') // Your project ID ; @@ -210,6 +211,7 @@ const client = new sdk.Client(); const functions = new sdk.Functions(client); client + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<PROJECT_ID>') // Your project ID ; @@ -217,8 +219,8 @@ const promise = functions.createExecution({ functionId: '<FUNCTION_ID>', body: '<BODY>', // optional async: false, // optional - path: '<PATH>', // optional - method: 'GET', // optional + xpath: '<PATH>', // optional + method: sdk.ExecutionMethod.GET, // optional headers: {} // optional }); @@ -237,6 +239,7 @@ let client = new sdk.Client(); let functions = new sdk.Functions(client); client + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<PROJECT_ID>') // Your project ID ; @@ -245,7 +248,7 @@ const promise = functions.createExecution({ body: '<BODY>', // optional async: false, // optional xpath: '<PATH>', // optional - method: 'GET', // optional + method: sdk.ExecutionMethod.GET, // optional headers: {} // optional }); @@ -752,18 +755,19 @@ const client = new sdk.Client(); const functions = new sdk.Functions(client); client + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<PROJECT_ID>') // Your project ID ; -const promise = functions.createExecution( - '<FUNCTION_ID>', // functionId - '<BODY>', // body (optional) - true, // Scheduled executions need to be async - '<PATH>', // path (optional) - ExecutionMethod.GET, // method (optional) - {}, // headers (optional) - '2020-10-15T06:38:00.000+00:00' // Schedule execution (optional) - ); +const promise = functions.createExecution({ + functionId: '<FUNCTION_ID>', + body: '<BODY>', + async: true, + xpath: '<PATH>', + method: sdk.ExecutionMethod.GET, + headers: {}, + scheduledAt: '<SCHEDULED_AT>' +}); promise.then(function (response) { console.log(response); // Success @@ -780,18 +784,19 @@ let client = new sdk.Client(); let functions = new sdk.Functions(client); client + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<PROJECT_ID>') // Your project ID ; -const promise = functions.createExecution( - '<FUNCTION_ID>', // functionId - '<BODY>', // body (optional) - true, // Scheduled executions need to be async - '<PATH>', // path (optional) - ExecutionMethod.GET, // method (optional) - {}, // headers (optional) - '2020-10-15T06:38:00.000+00:00' // Schedule execution (optional) - ); +const promise = functions.createExecution({ + functionId: '<FUNCTION_ID>', + body: '<BODY>', + async: true, + xpath: '<PATH>', + method: sdk.ExecutionMethod.GET, + headers: {}, + scheduledAt: '<SCHEDULED_AT>' +}); promise.then(function (response) { console.log(response); // Success diff --git a/src/routes/docs/products/messaging/apns/+page.markdoc b/src/routes/docs/products/messaging/apns/+page.markdoc index b542af02a1..ee791ef170 100644 --- a/src/routes/docs/products/messaging/apns/+page.markdoc +++ b/src/routes/docs/products/messaging/apns/+page.markdoc @@ -115,15 +115,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const provider = await messaging.updateApnsProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<AUTH_KEY>', // authKey (optional) - '<AUTH_KEY_ID>', // authKeyId (optional) - '<TEAM_ID>', // teamId (optional) - '<BUNDLE_ID>' // bundleId (optional) - ); +const provider = await messaging.updateApnsProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + authKey: '<AUTH_KEY>', + authKeyId: '<AUTH_KEY_ID>', + teamId: '<TEAM_ID>', + bundleId: '<BUNDLE_ID>' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -139,15 +139,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const provider = await messaging.updateApnsProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<AUTH_KEY>', // authKey (optional) - '<AUTH_KEY_ID>', // authKeyId (optional) - '<TEAM_ID>', // teamId (optional) - '<BUNDLE_ID>' // bundleId (optional) - ); +const provider = await messaging.updateApnsProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + authKey: '<AUTH_KEY>', + authKeyId: '<AUTH_KEY_ID>', + teamId: '<TEAM_ID>', + bundleId: '<BUNDLE_ID>' +}); ``` ```php <?php diff --git a/src/routes/docs/products/messaging/fcm/+page.markdoc b/src/routes/docs/products/messaging/fcm/+page.markdoc index d769eeee1f..2ab41759ed 100644 --- a/src/routes/docs/products/messaging/fcm/+page.markdoc +++ b/src/routes/docs/products/messaging/fcm/+page.markdoc @@ -138,12 +138,12 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const provider = await messaging.updateFCMProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - {} // serviceAccountJSON (optional) - ); +const provider = await messaging.updateFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + serviceAccountJSON: {} +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -159,12 +159,12 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const provider = await messaging.updateFCMProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - {} // serviceAccountJSON (optional) - ); +const provider = await messaging.updateFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + serviceAccountJSON: {} +}); ``` ```php <?php diff --git a/src/routes/docs/products/messaging/mailgun/+page.markdoc b/src/routes/docs/products/messaging/mailgun/+page.markdoc index 597b5e9186..2fe9d7d7e1 100644 --- a/src/routes/docs/products/messaging/mailgun/+page.markdoc +++ b/src/routes/docs/products/messaging/mailgun/+page.markdoc @@ -156,7 +156,11 @@ client = Client() messaging = Messaging(client) -result = messaging.create_email('<MESSAGE_ID>', '<SUBJECT>', '<CONTENT>') +result = messaging.create_email( + message_id='<MESSAGE_ID>', + subject='<SUBJECT>', + content='<CONTENT>' +) ``` ```ruby require 'appwrite' @@ -349,25 +353,27 @@ client ; // update provider -messaging.updateSendgridProvider( - '<PROVIDER_ID>', - '<PROVIDER_NAME>', - '<API_KEY>', - '<DOMAIN>', - '<IS_EU_REGION?>', - '<SENDER_NAME>', - '<SENDER_EMAIL>', - '<REPLY_TO_NAME>', - '<REPLY_TO_EMAIL>', - '<ENABLED?>', -).then(function (response) { +messaging.updateMailgunProvider({ + providerId: '<PROVIDER_ID>', + name: '<PROVIDER_NAME>', + apiKey: '<API_KEY>', + domain: '<DOMAIN>', + isEuRegion: false, + fromName: '<SENDER_NAME>', + fromEmail: '<SENDER_EMAIL>', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: '<REPLY_TO_EMAIL>', + enabled: true +}).then(function (response) { console.log(response); }, function (error) { console.log(error); }); // delete provider -messaging.deleteProvider('<PROVIDER_ID>') +messaging.deleteProvider({ + providerId: '<PROVIDER_ID>' +}) .then(function (response) { console.log(response); }, function (error) { @@ -383,25 +389,27 @@ let client = new sdk.Client(); let messaging = new sdk.Messaging(client); // update provider -messaging.updateSendgridProvider( - '<PROVIDER_ID>', - '<PROVIDER_NAME>', - '<API_KEY>', - '<DOMAIN>', - '<IS_EU_REGION?>', - '<SENDER_NAME>', - '<SENDER_EMAIL>', - '<REPLY_TO_NAME>', - '<REPLY_TO_EMAIL>', - '<ENABLED?>', -).then(function (response) { +messaging.updateMailgunProvider({ + providerId: '<PROVIDER_ID>', + name: '<PROVIDER_NAME>', + apiKey: '<API_KEY>', + domain: '<DOMAIN>', + isEuRegion: false, + fromName: '<SENDER_NAME>', + fromEmail: '<SENDER_EMAIL>', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: '<REPLY_TO_EMAIL>', + enabled: true +}).then(function (response) { console.log(response); }, function (error) { console.log(error); }); // delete provider -messaging.deleteProvider('<PROVIDER_ID>') +messaging.deleteProvider({ + providerId: '<PROVIDER_ID>' +}) .then(function (response) { console.log(response); }, function (error) { @@ -450,17 +458,17 @@ client = Client() messaging = Messaging(client) -result = messaging.update_sendgrid_provider( - '<PROVIDER_ID>', - '<PROVIDER_NAME>', - '<API_KEY>', - '<DOMAIN>', - '<IS_EU_REGION?>', - '<SENDER_NAME>', - '<SENDER_EMAIL>', - '<REPLY_TO_NAME>', - '<REPLY_TO_EMAIL>', - '<ENABLED?>', +result = messaging.update_mailgun_provider( + provider_id='<PROVIDER_ID>', + name='<PROVIDER_NAME>', + api_key='<API_KEY>', + domain='<DOMAIN>', + is_eu_region=False, + from_name='<SENDER_NAME>', + from_email='<SENDER_EMAIL>', + reply_to_name='<REPLY_TO_NAME>', + reply_to_email='<REPLY_TO_EMAIL>', + enabled=True, ) ``` ```ruby diff --git a/src/routes/docs/products/messaging/messages/+page.markdoc b/src/routes/docs/products/messaging/messages/+page.markdoc index b1a7e31e60..0d7ab6c973 100644 --- a/src/routes/docs/products/messaging/messages/+page.markdoc +++ b/src/routes/docs/products/messaging/messages/+page.markdoc @@ -249,26 +249,26 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createPush( - '<MESSAGE_ID>', // messageId - '<TITLE>', // title - '<BODY>', // body - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - {}, // data (optional) - '<ACTION>', // action (optional) - '<ICON>', // icon (optional) - '<SOUND>', // sound (optional) - '<COLOR>', // color (optional) - '<TAG>', // tag (optional) - 1, // badge (optional) - false, // contentAvailable (optional) - false, // critical (optional) - 'normal', // priority (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createPush({ + messageId: '<MESSAGE_ID>', + title: '<TITLE>', + body: '<BODY>', + topics: [], + users: [], + targets: [], + data: {}, + action: '<ACTION>', + icon: '<ICON>', + sound: '<SOUND>', + color: '<COLOR>', + tag: '<TAG>', + badge: 1, + contentAvailable: false, + critical: false, + priority: 'normal', + draft: true, + scheduledAt: '' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -284,26 +284,26 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createPush( - '<MESSAGE_ID>', // messageId - '<TITLE>', // title - '<BODY>', // body - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - {}, // data (optional) - '<ACTION>', // action (optional) - '<ICON>', // icon (optional) - '<SOUND>', // sound (optional) - '<COLOR>', // color (optional) - '<TAG>', // tag (optional) - 1, // badge (optional) - false, // contentAvailable (optional) - false, // critical (optional) - 'normal', // priority (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createPush({ + messageId: '<MESSAGE_ID>', + title: '<TITLE>', + body: '<BODY>', + topics: [], + users: [], + targets: [], + data: {}, + action: '<ACTION>', + icon: '<ICON>', + sound: '<SOUND>', + color: '<COLOR>', + tag: '<TAG>', + badge: 1, + contentAvailable: false, + critical: false, + priority: 'normal', + draft: true, + scheduledAt: '' +}); ``` ```php <?php @@ -660,19 +660,19 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message - await messaging.createEmail( - '<MESSAGE_ID>', // messageId - '<SUBJECT>', // subject - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - [], // cc (optional) - [], // bcc (optional) - true, // draft (optional) - false, // html (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createEmail({ + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + cc: [], + bcc: [], + draft: true, + html: false, + scheduledAt: '' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -688,19 +688,19 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message - await messaging.createEmail( - '<MESSAGE_ID>', // messageId - '<SUBJECT>', // subject - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - [], // cc (optional) - [], // bcc (optional) - true, // draft (optional) - false, // html (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createEmail({ + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + cc: [], + bcc: [], + draft: true, + html: false, + scheduledAt: '' +}); ``` ```php <?php @@ -997,15 +997,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: true, + scheduledAt: '' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -1021,15 +1021,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: true, + scheduledAt: '' +}); ``` ```php <?php diff --git a/src/routes/docs/products/messaging/msg91/+page.markdoc b/src/routes/docs/products/messaging/msg91/+page.markdoc index 62e4cd076a..28a525d70e 100644 --- a/src/routes/docs/products/messaging/msg91/+page.markdoc +++ b/src/routes/docs/products/messaging/msg91/+page.markdoc @@ -80,15 +80,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: true, + scheduledAt: '' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -104,15 +104,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: true, + scheduledAt: '' +}); ``` ```php <?php @@ -383,14 +383,14 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.updateMsg91Provider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<SENDER_ID>', // senderId (optional) - '<AUTH_KEY>', // authKey (optional) - '<FROM>' // from (optional) - ); +const message = await messaging.updateMsg91Provider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + templateId: '<TEMPLATE_ID>', + senderId: '<SENDER_ID>', + authKey: '<AUTH_KEY>' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -406,14 +406,14 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.updateMsg91Provider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<SENDER_ID>', // senderId (optional) - '<AUTH_KEY>', // authKey (optional) - '<FROM>' // from (optional) - ); +const message = await messaging.updateMsg91Provider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + templateId: '<TEMPLATE_ID>', + senderId: '<SENDER_ID>', + authKey: '<AUTH_KEY>' +}); ``` ```php <?php diff --git a/src/routes/docs/products/messaging/send-email-messages/+page.markdoc b/src/routes/docs/products/messaging/send-email-messages/+page.markdoc index 42a5efc026..8c16a5aac8 100644 --- a/src/routes/docs/products/messaging/send-email-messages/+page.markdoc +++ b/src/routes/docs/products/messaging/send-email-messages/+page.markdoc @@ -51,14 +51,14 @@ const client = new sdk.Client() const users = new sdk.Users(client); -const target = await users.createTarget( - '<USER_ID>', // userId - '<TARGET_ID>', // targetId - sdk.MessagingProviderType.Email, // providerType - '<IDENTIFIER>', // identifier - '<PROVIDER_ID>', // providerId (optional) - '<NAME>' // name (optional) -); +const target = await users.createTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: sdk.MessagingProviderType.Email, + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', + name: '<NAME>' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -70,14 +70,14 @@ const client = new sdk.Client() const users = new sdk.Users(client); -const target = await users.createTarget( - '<USER_ID>', // userId - '<TARGET_ID>', // targetId - sdk.MessagingProviderType.Email, // providerType - '<IDENTIFIER>', // identifier - '<PROVIDER_ID>', // providerId (optional) - '<NAME>' // name (optional) -); +const target = await users.createTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: sdk.MessagingProviderType.Email, + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', + name: '<NAME>' +}); ``` ```php <?php @@ -319,10 +319,10 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const topic = await messaging.createTopic( - '<TOPIC_ID>', // topicId - '<NAME>' // name - ); +const topic = await messaging.createTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -338,10 +338,10 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const topic = await messaging.createTopic( - '<TOPIC_ID>', // topicId - '<NAME>' // name - ); +const topic = await messaging.createTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>' +}); ``` ```php <?php @@ -554,20 +554,20 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createEmail( - '<MESSAGE_ID>', // messageId - '<SUBJECT>', // subject - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - [], // cc (optional) - [], // bcc (optional) - [], // attachments (optional) - false, // draft (optional) - false, // html (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createEmail({ + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + cc: [], + bcc: [], + attachments: [], + draft: false, + html: false, + scheduledAt: '' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -583,20 +583,20 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createEmail( - '<MESSAGE_ID>', // messageId - '<SUBJECT>', // subject - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - [], // cc (optional) - [], // bcc (optional) - [], // attachments (optional) - false, // draft (optional) - false, // html (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createEmail({ + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + cc: [], + bcc: [], + attachments: [], + draft: false, + html: false, + scheduledAt: '' +}); ``` ```php <?php @@ -890,19 +890,19 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createEmail( - '<MESSAGE_ID>', // messageId - '<SUBJECT>', // subject - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - [], // cc (optional) - [], // bcc (optional) - false, // draft (optional) - false, // html (optional) - '2025-02-13T22:01:00+0000' // scheduledAt (optional) - ); +const message = await messaging.createEmail({ + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + cc: [], + bcc: [], + draft: false, + html: false, + scheduledAt: '2025-02-13T22:01:00+0000' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -918,19 +918,19 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message - await messaging.createEmail( - '<MESSAGE_ID>', // messageId - '<SUBJECT>', // subject - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - [], // cc (optional) - [], // bcc (optional) - false, // draft (optional) - false, // html (optional) - '2025-02-13T22:01:00+0000' // scheduledAt (optional) - ); +const message = await messaging.createEmail({ + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + cc: [], + bcc: [], + draft: false, + html: false, + scheduledAt: '2025-02-13T22:01:00+0000' +}); ``` ```php <?php diff --git a/src/routes/docs/products/messaging/send-sms-messages/+page.markdoc b/src/routes/docs/products/messaging/send-sms-messages/+page.markdoc index b5b10245f8..38ae523ace 100644 --- a/src/routes/docs/products/messaging/send-sms-messages/+page.markdoc +++ b/src/routes/docs/products/messaging/send-sms-messages/+page.markdoc @@ -60,14 +60,14 @@ const client = new sdk.Client() const users = new sdk.Users(client); -const target = await users.createTarget( - '<USER_ID>', // userId - '<TARGET_ID>', // targetId - sdk.MessagingProviderType.Phone, // providerType - '<IDENTIFIER>', // identifier - '<PROVIDER_ID>', // providerId (optional) - '<NAME>' // name (optional) -); +const target = await users.createTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: sdk.MessagingProviderType.Phone, + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', + name: '<NAME>' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -79,14 +79,14 @@ const client = new sdk.Client() const users = new sdk.Users(client); -const target = await users.createTarget( - '<USER_ID>', // userId - '<TARGET_ID>', // targetId - sdk.MessagingProviderType.Phone, // providerType - '<IDENTIFIER>', // identifier - '<PROVIDER_ID>', // providerId (optional) - '<NAME>' // name (optional) -); +const target = await users.createTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: sdk.MessagingProviderType.Phone, + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', + name: '<NAME>' +}); ``` ```php <?php @@ -325,10 +325,10 @@ const client = new sdk.Client() const messaging = new sdk.Messaging(client); -const topic = await messaging.createTopic( - '<TOPIC_ID>', // topicId - '<NAME>' // name -); +const topic = await messaging.createTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -340,10 +340,10 @@ const client = new sdk.Client() const messaging = new sdk.Messaging(client); -const topic = await messaging.createTopic( - '<TOPIC_ID>', // topicId - '<NAME>' // name -); +const topic = await messaging.createTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>' +}); ``` ```php <?php @@ -527,15 +527,15 @@ const client = new sdk.Client() const messaging = new sdk.Messaging(client); -const message = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - false, // draft (optional) - '' // scheduledAt (optional) -); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: false, + scheduledAt: '' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -547,15 +547,15 @@ const client = new sdk.Client() const messaging = new sdk.Messaging(client); -const message = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - false, // draft (optional) - '' // scheduledAt (optional) -); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: false, + scheduledAt: '' +}); ``` ```php <?php @@ -783,15 +783,15 @@ const client = new sdk.Client() const messaging = new sdk.Messaging(client); -const message = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - false, // draft (optional) - '2025-02-13T22:01:00+0000' // scheduledAt (optional) -); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: false, + scheduledAt: '2025-02-13T22:01:00+0000' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -803,15 +803,15 @@ const client = new sdk.Client() const messaging = new sdk.Messaging(client); -const message = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - false, // draft (optional) - '2025-02-13T22:01:00+0000' // scheduledAt (optional) -); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: false, + scheduledAt: '2025-02-13T22:01:00+0000' +}); ``` ```php <?php diff --git a/src/routes/docs/products/messaging/sendgrid/+page.markdoc b/src/routes/docs/products/messaging/sendgrid/+page.markdoc index 0ce661d1af..ed658923ef 100644 --- a/src/routes/docs/products/messaging/sendgrid/+page.markdoc +++ b/src/routes/docs/products/messaging/sendgrid/+page.markdoc @@ -149,7 +149,11 @@ client = Client() messaging = Messaging(client) -result = messaging.create_email('<MESSAGE_ID>', '<SUBJECT>', '<CONTENT>') +result = messaging.create_email( + message_id='<MESSAGE_ID>', + subject='<SUBJECT>', + content='<CONTENT>' +) ``` ```ruby require 'appwrite' @@ -341,16 +345,16 @@ client .setKey('<YOUR_API_KEY>') // Your secret API key ; -const provider = await messaging.updateSendgridProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - '<API_KEY>', // apiKey (optional) - false, // enabled (optional) - '<FROM_NAME>', // fromName (optional) - 'email@example.com', // fromEmail (optional) - '<REPLY_TO_NAME>', // replyToName (optional) - '<REPLY_TO_EMAIL>' // replyToEmail (optional) - ); +const provider = await messaging.updateSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + apiKey: '<API_KEY>', + fromName: '<FROM_NAME>', + fromEmail: 'email@example.com', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: '<REPLY_TO_EMAIL>' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -366,16 +370,16 @@ client .setKey('<YOUR_API_KEY>') // Your secret API key ; -const provider = await messaging.updateSendgridProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - '<API_KEY>', // apiKey (optional) - false, // enabled (optional) - '<FROM_NAME>', // fromName (optional) - 'email@example.com', // fromEmail (optional) - '<REPLY_TO_NAME>', // replyToName (optional) - '<REPLY_TO_EMAIL>' // replyToEmail (optional) - ); +const provider = await messaging.updateSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + apiKey: '<API_KEY>', + fromName: '<FROM_NAME>', + fromEmail: 'email@example.com', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: '<REPLY_TO_EMAIL>' +}); ``` ```php <?php diff --git a/src/routes/docs/products/messaging/smtp/+page.markdoc b/src/routes/docs/products/messaging/smtp/+page.markdoc index 055fdad50b..ec98d9dd43 100644 --- a/src/routes/docs/products/messaging/smtp/+page.markdoc +++ b/src/routes/docs/products/messaging/smtp/+page.markdoc @@ -158,7 +158,11 @@ client = Client() messaging = Messaging(client) -result = messaging.create_email('<MESSAGE_ID>', '<SUBJECT>', '<CONTENT>') +result = messaging.create_email( + message_id='<MESSAGE_ID>', + subject='<SUBJECT>', + content='<CONTENT>' +) ``` ```ruby require 'appwrite' @@ -351,25 +355,31 @@ client ; // update provider -messaging.updateSendgridProvider( - '<PROVIDER_ID>', - '<PROVIDER_NAME>', - '<API_KEY>', - '<DOMAIN>', - '<IS_EU_REGION?>', - '<SENDER_NAME>', - '<SENDER_EMAIL>', - '<REPLY_TO_NAME>', - '<REPLY_TO_EMAIL>', - '<ENABLED?>', -).then(function (response) { +messaging.updateSmtpProvider({ + providerId: '<PROVIDER_ID>', + name: '<PROVIDER_NAME>', + host: '<HOST>', + port: 587, + username: '<USERNAME>', + password: '<PASSWORD>', + encryption: sdk.SmtpEncryption.Tls, + autoTLS: true, + mailer: '<MAILER>', + fromName: '<SENDER_NAME>', + fromEmail: '<SENDER_EMAIL>', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: '<REPLY_TO_EMAIL>', + enabled: true +}).then(function (response) { console.log(response); }, function (error) { console.log(error); }); // delete provider -messaging.deleteProvider('<PROVIDER_ID>') +messaging.deleteProvider({ + providerId: '<PROVIDER_ID>' +}) .then(function (response) { console.log(response); }, function (error) { @@ -385,25 +395,31 @@ let client = new sdk.Client(); let messaging = new sdk.Messaging(client); // update provider -messaging.updateSendgridProvider( - '<PROVIDER_ID>', - '<PROVIDER_NAME>', - '<API_KEY>', - '<DOMAIN>', - '<IS_EU_REGION?>', - '<SENDER_NAME>', - '<SENDER_EMAIL>', - '<REPLY_TO_NAME>', - '<REPLY_TO_EMAIL>', - '<ENABLED?>', -).then(function (response) { +messaging.updateSmtpProvider({ + providerId: '<PROVIDER_ID>', + name: '<PROVIDER_NAME>', + host: '<HOST>', + port: 587, + username: '<USERNAME>', + password: '<PASSWORD>', + encryption: sdk.SmtpEncryption.Tls, + autoTLS: true, + mailer: '<MAILER>', + fromName: '<SENDER_NAME>', + fromEmail: '<SENDER_EMAIL>', + replyToName: '<REPLY_TO_NAME>', + replyToEmail: '<REPLY_TO_EMAIL>', + enabled: true +}).then(function (response) { console.log(response); }, function (error) { console.log(error); }); // delete provider -messaging.deleteProvider('<PROVIDER_ID>') +messaging.deleteProvider({ + providerId: '<PROVIDER_ID>' +}) .then(function (response) { console.log(response); }, function (error) { @@ -452,17 +468,21 @@ client = Client() messaging = Messaging(client) -result = messaging.update_sendgrid_provider( - '<PROVIDER_ID>', - '<PROVIDER_NAME>', - '<API_KEY>', - '<DOMAIN>', - '<IS_EU_REGION?>', - '<SENDER_NAME>', - '<SENDER_EMAIL>', - '<REPLY_TO_NAME>', - '<REPLY_TO_EMAIL>', - '<ENABLED?>', +result = messaging.update_smtp_provider( + provider_id='<PROVIDER_ID>', + name='<PROVIDER_NAME>', + host='<HOST>', + port=587, + username='<USERNAME>', + password='<PASSWORD>', + encryption='tls', + auto_tls=True, + mailer='<MAILER>', + from_name='<SENDER_NAME>', + from_email='<SENDER_EMAIL>', + reply_to_name='<REPLY_TO_NAME>', + reply_to_email='<REPLY_TO_EMAIL>', + enabled=True, ) ``` ```ruby diff --git a/src/routes/docs/products/messaging/telesign/+page.markdoc b/src/routes/docs/products/messaging/telesign/+page.markdoc index db63679d53..2fc4f7172a 100644 --- a/src/routes/docs/products/messaging/telesign/+page.markdoc +++ b/src/routes/docs/products/messaging/telesign/+page.markdoc @@ -79,15 +79,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const messaging = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: true, + scheduledAt: '' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -103,15 +103,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const messaging = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: true, + scheduledAt: '' +}); ``` ```php <?php @@ -381,14 +381,14 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const provider = await messaging.updateTelesignProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<USERNAME>', // username (optional) - '<PASSWORD>', // password (optional) - '<FROM>' // from (optional) - ); +const provider = await messaging.updateTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + customerId: '<CUSTOMER_ID>', + apiKey: '<API_KEY>', + from: '<FROM>' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -404,14 +404,14 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const provider = await messaging.updateTelesignProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<USERNAME>', // username (optional) - '<PASSWORD>', // password (optional) - '<FROM>' // from (optional) - ); +const provider = await messaging.updateTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + customerId: '<CUSTOMER_ID>', + apiKey: '<API_KEY>', + from: '<FROM>' +}); ``` ```php <?php diff --git a/src/routes/docs/products/messaging/textmagic/+page.markdoc b/src/routes/docs/products/messaging/textmagic/+page.markdoc index bd9e5869dd..2e1c7e6f52 100644 --- a/src/routes/docs/products/messaging/textmagic/+page.markdoc +++ b/src/routes/docs/products/messaging/textmagic/+page.markdoc @@ -79,15 +79,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const messaging = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: true, + scheduledAt: '' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -103,15 +103,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const messaging = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: true, + scheduledAt: '' +}); ``` ```php <?php @@ -381,14 +381,14 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const provider = await messaging.updateTextmagicProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<USERNAME>', // username (optional) - '<API_KEY>', // apiKey (optional) - '<FROM>' // from (optional) - ); +const provider = await messaging.updateTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + username: '<USERNAME>', + apiKey: '<API_KEY>', + from: '<FROM>' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -404,14 +404,14 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const provider = await messaging.updateTextmagicProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<USERNAME>', // username (optional) - '<API_KEY>', // apiKey (optional) - '<FROM>' // from (optional) - ); +const provider = await messaging.updateTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + username: '<USERNAME>', + apiKey: '<API_KEY>', + from: '<FROM>' +}); ``` ```php <?php diff --git a/src/routes/docs/products/messaging/topics/+page.markdoc b/src/routes/docs/products/messaging/topics/+page.markdoc index 33f783ebb7..515b3b29aa 100644 --- a/src/routes/docs/products/messaging/topics/+page.markdoc +++ b/src/routes/docs/products/messaging/topics/+page.markdoc @@ -58,11 +58,11 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const topic = messaging.createTopic( - '<TOPIC_ID>', // topicId - '<NAME>', // name - '<ROLES>' // permission roles for who can subscribe - ); +const topic = messaging.createTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ['<ROLE>'] +}); ``` ```deno @@ -80,15 +80,10 @@ client ; const topic = messaging.createTopic({ - topicId: '<TOPIC_ID>', - name: '<NAME>', - subscribe: '<ROLES>' // permission roles for who can subscribe - }); -const topic = messaging.createTopic( - '<TOPIC_ID>', // topicId - '<NAME>', // name - '<ROLES>' // permission roles for who can subscribe - ); + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ['<ROLE>'] +}); ``` ```php <?php @@ -353,11 +348,11 @@ const client = new sdk.Client() const messaging = new sdk.Messaging(client); -const subscriber = await messaging.createSubscriber( - '<TOPIC_ID>', // topicId - '<SUBSCRIBER_ID>', // subscriberId - '<TARGET_ID>' // targetId -); +const subscriber = await messaging.createSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; diff --git a/src/routes/docs/products/messaging/twilio/+page.markdoc b/src/routes/docs/products/messaging/twilio/+page.markdoc index f97e0b451e..b46c6b7ee4 100644 --- a/src/routes/docs/products/messaging/twilio/+page.markdoc +++ b/src/routes/docs/products/messaging/twilio/+page.markdoc @@ -81,15 +81,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: true, + scheduledAt: '' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -105,15 +105,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: true, + scheduledAt: '' +}); ``` ```php <?php @@ -381,14 +381,14 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const provider = await messaging.updateTwilioProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<ACCOUNT_SID>', // accountSid (optional) - '<AUTH_TOKEN>', // authToken (optional) - '<FROM>' // from (optional) - ); +const provider = await messaging.updateTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + accountSid: '<ACCOUNT_SID>', + authToken: '<AUTH_TOKEN>', + from: '<FROM>' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -404,14 +404,14 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const provider = await messaging.updateTwilioProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<ACCOUNT_SID>', // accountSid (optional) - '<AUTH_TOKEN>', // authToken (optional) - '<FROM>' // from (optional) - ); +const provider = await messaging.updateTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + accountSid: '<ACCOUNT_SID>', + authToken: '<AUTH_TOKEN>', + from: '<FROM>' +}); ``` ```php <?php diff --git a/src/routes/docs/products/messaging/vonage/+page.markdoc b/src/routes/docs/products/messaging/vonage/+page.markdoc index e3ff2728df..7b0f0a0170 100644 --- a/src/routes/docs/products/messaging/vonage/+page.markdoc +++ b/src/routes/docs/products/messaging/vonage/+page.markdoc @@ -81,15 +81,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: true, + scheduledAt: '' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -105,15 +105,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const message = await messaging.createSms( - '<MESSAGE_ID>', // messageId - '<CONTENT>', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - true, // draft (optional) - '' // scheduledAt (optional) - ); +const message = await messaging.createSms({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], + users: [], + targets: [], + draft: true, + scheduledAt: '' +}); ``` ```php <?php @@ -383,14 +383,14 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const provider = await messaging.updateVonageProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<API_KEY>', // apiKey (optional) - '<API_SECRET>', // apiSecret (optional) - '<FROM>' // from (optional) - ); +const provider = await messaging.updateVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + apiKey: '<API_KEY>', + apiSecret: '<API_SECRET>', + from: '<FROM>' +}); ``` ```deno import * as sdk from "npm:node-appwrite"; @@ -406,14 +406,14 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const provider = await messaging.updateVonageProvider( - '<PROVIDER_ID>', // providerId - '<NAME>', // name (optional) - false, // enabled (optional) - '<API_KEY>', // apiKey (optional) - '<API_SECRET>', // apiSecret (optional) - '<FROM>' // from (optional) - ); +const provider = await messaging.updateVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + enabled: false, + apiKey: '<API_KEY>', + apiSecret: '<API_SECRET>', + from: '<FROM>' +}); ``` ```php <?php diff --git a/src/routes/docs/products/network/caching/+page.markdoc b/src/routes/docs/products/network/caching/+page.markdoc index 8b055fc04b..81b6154d77 100644 --- a/src/routes/docs/products/network/caching/+page.markdoc +++ b/src/routes/docs/products/network/caching/+page.markdoc @@ -8,29 +8,29 @@ Appwrite employs a multi-layered caching approach to enhance the performance of # Region-level {% #region-level %} -At the region level, Appwrite provides smart in-memory caching for various resources: +At the region level, Appwrite provides smart in-memory caching for various resources: -- **Documents**: Frequently accessed rows are cached in memory and automatically purged when updated, ensuring data consistency without manual intervention. -- **Storage files**: Frequently accessed files are cached in memory to reduce disk reads and improve performance. -- **Image transformations**: Processed images (e.g., resized or converted) are cached in memory for faster repeated requests, reducing processing overhead. +- **Rows**: Frequently accessed rows are cached in memory and automatically purged when updated, ensuring data consistency without manual intervention. +- **Storage files**: Frequently accessed files are cached in memory to reduce disk reads and improve performance. +- **Image transformations**: Processed images (e.g., resized or converted) are cached in memory for faster repeated requests, reducing processing overhead. Region-level caching is tightly integrated with Appwrite's APIs, optimizing performance while preserving data integrity. # Edge-level {% #edge-level %} -At the edge, Appwrite employs smart caching for specific use cases: +At the edge, Appwrite employs smart caching for specific use cases: -- **Compute builds**: Caches build artifacts for faster deployments and reduced latency during function executions. -- **Cold starts**: Pre-loads frequently accessed resources, reducing latency for new requests and improving application responsiveness. +- **Compute builds**: Caches build artifacts for faster deployments and reduced latency during function executions. +- **Cold starts**: Pre-loads frequently accessed resources, reducing latency for new requests and improving application responsiveness. Edge-level caching complements region-level caching, ensuring optimal performance for globally distributed applications. # Private caching {% #cdn-caching %} Appwrite's CDN layer includes **private caching**, a caching strategy designed to handle the dynamic and permission-sensitive nature of Appwrite's APIs and resources securely. -**What is private caching?** +**What is private caching?** -In the HTTP context, private caching allows responses to be cached but ensures they are only served to the specific user or client that requested them. This is achieved using HTTP headers that control caching behavior. For example: +In the HTTP context, private caching allows responses to be cached but ensures they are only served to the specific user or client that requested them. This is achieved using HTTP headers that control caching behavior. For example: - `Cache-Control: private, max-age=3600` Indicates that the response can be cached, but only in a private cache (e.g., the user's browser). @@ -58,4 +58,4 @@ Enterprise customers can collaborate with their Appwrite success manager to defi - Defining exclusion rules for sensitive or frequently changing data. - Optimizing cache invalidation strategies for complex workflows. -For more information on upgrading to the enterprise plan, [contact sales](https://appwrite.io/contact-us/enterprise). \ No newline at end of file +For more information on upgrading to the enterprise plan, [contact sales](https://appwrite.io/contact-us/enterprise). diff --git a/src/routes/docs/products/network/compression/+page.markdoc b/src/routes/docs/products/network/compression/+page.markdoc index f588bda1d2..0111cf898c 100644 --- a/src/routes/docs/products/network/compression/+page.markdoc +++ b/src/routes/docs/products/network/compression/+page.markdoc @@ -80,21 +80,21 @@ client .setProject('<PROJECT_ID>') // Your project ID ; -const result = storage.getFilePreview( - 'photos', // bucket ID - 'sunset.png', // file ID - 1800, // width, will be resized using this value. - 0, // height, ignored when 0 - 'center', // crop center - '90', // slight compression - 5, // border width - 'CDCA30', // border color - 15, // border radius - 1, // full opacity - 0, // no rotation - 'FFFFFF', // background color - 'webp' // output jpg format -); +const result = storage.getFilePreview({ + bucketId: 'photos', + fileId: 'sunset.png', + width: 1800, + height: 0, + gravity: 'center', + quality: '90', + borderWidth: 5, + borderColor: 'CDCA30', + borderRadius: 15, + opacity: 1, + rotation: 0, + background: 'FFFFFF', + output: 'webp' +}); console.log(result.href); ``` diff --git a/src/routes/docs/products/storage/buckets/+page.markdoc b/src/routes/docs/products/storage/buckets/+page.markdoc index fb5f76e494..0236ab73b7 100644 --- a/src/routes/docs/products/storage/buckets/+page.markdoc +++ b/src/routes/docs/products/storage/buckets/+page.markdoc @@ -110,7 +110,7 @@ client = Client() storage = Storage(client) -result = storage.create_bucket('<BUCKET_ID>', '<NAME>') +result = storage.create_bucket(bucket_id='<BUCKET_ID>', name='<NAME>') ``` ```ruby require 'Appwrite' diff --git a/src/routes/docs/quick-starts/apple/+page.markdoc b/src/routes/docs/quick-starts/apple/+page.markdoc index 56c4d665fd..b542412cac 100644 --- a/src/routes/docs/quick-starts/apple/+page.markdoc +++ b/src/routes/docs/quick-starts/apple/+page.markdoc @@ -232,7 +232,7 @@ do { ``` {% info title="Generate types automatically" %} -Use the [Appwrite CLI](/docs/products/databases/type-generation) to generate model structs automatically: `appwrite types collection` +Use the [Appwrite CLI](/docs/products/databases/type-generation) to generate model structs automatically: `appwrite types ./models` {% /info %} {% /section %} diff --git a/src/routes/docs/quick-starts/go/+page.markdoc b/src/routes/docs/quick-starts/go/+page.markdoc index ccd5cf4dd1..9618e85d56 100644 --- a/src/routes/docs/quick-starts/go/+page.markdoc +++ b/src/routes/docs/quick-starts/go/+page.markdoc @@ -202,8 +202,8 @@ type Todo struct { } type TodoList struct { - *models.DocumentList - Documents []Todo `json:"rows"` + *models.RowList + Rows []Todo `json:"rows"` } func getTodos() { @@ -217,7 +217,7 @@ func getTodos() { todoResponse.Decode(&todos) fmt.Println("Todos:") - for _, todo := range todos.Documents { + for _, todo := range todos.Rows { fmt.Printf("Title: %s\nDescription: %s\nIs Todo Complete: %t\n\n", todo.Title, todo.Description, todo.IsComplete) } } @@ -238,7 +238,7 @@ func getCompletedTodos() { todoResponse.Decode(&todos) fmt.Println("Completed todos (limited to 5):") - for _, todo := range todos.Documents { + for _, todo := range todos.Rows { fmt.Printf("Title: %s\nDescription: %s\nIs Todo Complete: %t\n\n", todo.Title, todo.Description, todo.IsComplete) } } @@ -258,7 +258,7 @@ func getIncompleteTodos() { todoResponse.Decode(&todos) fmt.Println("Incomplete todos (ordered by title):") - for _, todo := range todos.Documents { + for _, todo := range todos.Rows { fmt.Printf("Title: %s\nDescription: %s\nIs Todo Complete: %t\n\n", todo.Title, todo.Description, todo.IsComplete) } } @@ -307,4 +307,4 @@ func main() { Run your project with `go run .` and view the response in your console. -{% /section %} \ No newline at end of file +{% /section %} diff --git a/src/routes/docs/quick-starts/go/prompt.md b/src/routes/docs/quick-starts/go/prompt.md index 5036401ad4..d6c8374645 100644 --- a/src/routes/docs/quick-starts/go/prompt.md +++ b/src/routes/docs/quick-starts/go/prompt.md @@ -168,8 +168,8 @@ type Todo struct { } type TodoList struct { - *models.DocumentList - Documents []Todo `json:"rows"` + *models.RowList + Rows []Todo `json:"rows"` } ``` @@ -186,7 +186,7 @@ func getTodos() { todoResponse.Decode(&todos) fmt.Println("Todos:") - for _, todo := range todos.Documents { + for _, todo := range todos.Rows { fmt.Printf("Title: %s\nDescription: %s\nIs Todo Complete: %t\n\n", todo.Title, todo.Description, todo.IsComplete) } } @@ -210,7 +210,7 @@ func getCompletedTodos() { todoResponse.Decode(&todos) fmt.Println("Completed todos (limited to 5):") - for _, todo := range todos.Documents { + for _, todo := range todos.Rows { fmt.Printf("Title: %s\nDescription: %s\nIs Todo Complete: %t\n\n", todo.Title, todo.Description, todo.IsComplete) } } @@ -233,7 +233,7 @@ func getIncompleteTodos() { todoResponse.Decode(&todos) fmt.Println("Incomplete todos (ordered by title):") - for _, todo := range todos.Documents { + for _, todo := range todos.Rows { fmt.Printf("Title: %s\nDescription: %s\nIs Todo Complete: %t\n\n", todo.Title, todo.Description, todo.IsComplete) } } diff --git a/src/routes/docs/tooling/ai/agents/antigravity/+page.markdoc b/src/routes/docs/tooling/ai/agents/antigravity/+page.markdoc index 3c32208631..a12dc4d0dd 100644 --- a/src/routes/docs/tooling/ai/agents/antigravity/+page.markdoc +++ b/src/routes/docs/tooling/ai/agents/antigravity/+page.markdoc @@ -112,8 +112,8 @@ Open **Agent Manager** in Antigravity to test your MCP integrations. You can try - `Create a new user in my Appwrite project` - `List all databases in my project` -- `Show me the collections in my database` -- `Create a new document in my collection` +- `Show me the tables in my database` +- `Create a new row in my table` - `Delete a specific user by ID` {% /tabsitem %} diff --git a/src/routes/docs/tooling/ai/agents/claude-code/+page.markdoc b/src/routes/docs/tooling/ai/agents/claude-code/+page.markdoc index e19e48de68..06f747a41f 100644 --- a/src/routes/docs/tooling/ai/agents/claude-code/+page.markdoc +++ b/src/routes/docs/tooling/ai/agents/claude-code/+page.markdoc @@ -123,8 +123,8 @@ Try out the following example prompts based on the MCP server you have configure - `Create a new user in my Appwrite project` - `List all databases in my project` -- `Show me the collections in my database` -- `Create a new document in my collection` +- `Show me the tables in my database` +- `Create a new row in my table` - `Delete a specific user by ID` {% /tabsitem %} diff --git a/src/routes/docs/tooling/ai/agents/codex/+page.markdoc b/src/routes/docs/tooling/ai/agents/codex/+page.markdoc index d3899251ef..5545d67a58 100644 --- a/src/routes/docs/tooling/ai/agents/codex/+page.markdoc +++ b/src/routes/docs/tooling/ai/agents/codex/+page.markdoc @@ -114,8 +114,8 @@ Try out the following example prompts based on the MCP server you have configure - `Create a new user in my Appwrite project` - `List all databases in my project` -- `Show me the collections in my database` -- `Create a new document in my collection` +- `Show me the tables in my database` +- `Create a new row in my table` - `Delete a specific user by ID` {% /tabsitem %} diff --git a/src/routes/docs/tooling/ai/agents/opencode/+page.markdoc b/src/routes/docs/tooling/ai/agents/opencode/+page.markdoc index ab5cf9bfdd..2b77c4e64d 100644 --- a/src/routes/docs/tooling/ai/agents/opencode/+page.markdoc +++ b/src/routes/docs/tooling/ai/agents/opencode/+page.markdoc @@ -108,8 +108,8 @@ Try out the following example prompts based on the MCP server you have configure - `Create a new user in my Appwrite project` - `List all databases in my project` -- `Show me the collections in my database` -- `Create a new document in my collection` +- `Show me the tables in my database` +- `Create a new row in my table` - `Delete a specific user by ID` {% /tabsitem %} diff --git a/src/routes/docs/tooling/ai/agents/vscode/+page.markdoc b/src/routes/docs/tooling/ai/agents/vscode/+page.markdoc index 551f7939f7..8d36c435d7 100644 --- a/src/routes/docs/tooling/ai/agents/vscode/+page.markdoc +++ b/src/routes/docs/tooling/ai/agents/vscode/+page.markdoc @@ -111,8 +111,8 @@ Open **Copilot Chat** in VS Code and switch to **Agent Mode** to test your MCP i - `Create a new user in my Appwrite project` - `List all databases in my project` -- `Show me the collections in my database` -- `Create a new document in my collection` +- `Show me the tables in my database` +- `Create a new row in my table` - `Delete a specific user by ID` {% /tabsitem %} diff --git a/src/routes/docs/tooling/ai/agents/windsurf/+page.markdoc b/src/routes/docs/tooling/ai/agents/windsurf/+page.markdoc index 8d22ff0259..1779be52ca 100644 --- a/src/routes/docs/tooling/ai/agents/windsurf/+page.markdoc +++ b/src/routes/docs/tooling/ai/agents/windsurf/+page.markdoc @@ -112,8 +112,8 @@ Open Cascade chat in the Windsurf Editor and test your MCP integrations. You can - `Create a new user in my Appwrite project` - `List all databases in my project` -- `Show me the collections in my database` -- `Create a new document in my collection` +- `Show me the tables in my database` +- `Create a new row in my table` - `Delete a specific user by ID` {% /tabsitem %} diff --git a/src/routes/docs/tooling/ai/vibe-coding/claude-desktop/+page.markdoc b/src/routes/docs/tooling/ai/vibe-coding/claude-desktop/+page.markdoc index 6f300d9618..6c43913419 100644 --- a/src/routes/docs/tooling/ai/vibe-coding/claude-desktop/+page.markdoc +++ b/src/routes/docs/tooling/ai/vibe-coding/claude-desktop/+page.markdoc @@ -132,8 +132,8 @@ Try out the following example prompts based on the MCP server you have configure - `Create a new user in my Appwrite project` - `List all databases in my project` -- `Show me the collections in my database` -- `Create a new document in my collection` +- `Show me the tables in my database` +- `Create a new row in my table` - `Delete a specific user by ID` {% /tabsitem %} diff --git a/src/routes/docs/tooling/ai/vibe-coding/emergent/+page.markdoc b/src/routes/docs/tooling/ai/vibe-coding/emergent/+page.markdoc index 54a749c861..e4b66feda8 100644 --- a/src/routes/docs/tooling/ai/vibe-coding/emergent/+page.markdoc +++ b/src/routes/docs/tooling/ai/vibe-coding/emergent/+page.markdoc @@ -77,8 +77,8 @@ Once connected, you can use natural language to interact with Appwrite. Try prom - `Create a new user in my Appwrite project` - `List all databases in my project` -- `Show me the collections in my database` -- `Create a new document in my collection` +- `Show me the tables in my database` +- `Create a new row in my table` - `Delete a specific user by ID` {% /tabsitem %} @@ -96,4 +96,4 @@ Once connected, you can use natural language to interact with Appwrite. Try prom {% /tabsitem %} {% /tabs %} -{% /section %} \ No newline at end of file +{% /section %} diff --git a/src/routes/docs/tooling/ai/vibe-coding/zenflow/+page.markdoc b/src/routes/docs/tooling/ai/vibe-coding/zenflow/+page.markdoc index 228da1ef77..014e4824e7 100644 --- a/src/routes/docs/tooling/ai/vibe-coding/zenflow/+page.markdoc +++ b/src/routes/docs/tooling/ai/vibe-coding/zenflow/+page.markdoc @@ -111,8 +111,8 @@ You can try out the following example prompts based on the MCP server you have c **Example prompts:** - `Create a new user in my Appwrite project` - `List all databases in my project` -- `Show me the collections in my database` -- `Create a new document in my collection` +- `Show me the tables in my database` +- `Create a new row in my table` - `Delete a specific user by ID` {% /tabsitem %} diff --git a/src/routes/docs/tooling/command-line/commands/+page.markdoc b/src/routes/docs/tooling/command-line/commands/+page.markdoc index 23dd296087..cb3ca88b46 100644 --- a/src/routes/docs/tooling/command-line/commands/+page.markdoc +++ b/src/routes/docs/tooling/command-line/commands/+page.markdoc @@ -228,7 +228,7 @@ List commands across services accept a set of dedicated flags for the most commo * Return results before this cursor ID. Use for backward cursor pagination. --- * `--select <attribute>` -* Limit returned attributes on row and document list commands such as `tables-db list-rows`. Repeat the flag to include multiple attributes. +* Limit returned attributes on list commands such as `tables-db list-rows`. Repeat the flag to include multiple attributes. --- {% /table %} diff --git a/src/routes/docs/tooling/command-line/installation/+page.markdoc b/src/routes/docs/tooling/command-line/installation/+page.markdoc index 525b3984c8..3cb8ff3bfb 100644 --- a/src/routes/docs/tooling/command-line/installation/+page.markdoc +++ b/src/routes/docs/tooling/command-line/installation/+page.markdoc @@ -206,7 +206,7 @@ The CLI resolves resource paths relative to the file that defines the resource. The single-file format continues to work. You can split any supported resource arrays over time and keep other arrays in the root config. -Supported include keys are `functions`, `sites`, `databases`, `collections`, `tablesDB`, `tables`, `topics`, `teams`, `buckets`, `webhooks`, and `messages`. +Supported include keys are `functions`, `sites`, `databases`, `tablesDB`, `tables`, `topics`, `teams`, `buckets`, `webhooks`, and `messages`. Include paths must be local JSON files inside your project. They must be relative paths, end in `.json`, and cannot use parent-directory segments, absolute paths, URLs, URL-like schemes, null bytes, or JSON pointer fragments. diff --git a/src/routes/docs/tooling/command-line/tables/+page.markdoc b/src/routes/docs/tooling/command-line/tables/+page.markdoc index 9f3e9311ca..fce69034d9 100644 --- a/src/routes/docs/tooling/command-line/tables/+page.markdoc +++ b/src/routes/docs/tooling/command-line/tables/+page.markdoc @@ -227,6 +227,12 @@ appwrite tables-db [COMMAND] [OPTIONS] * `update-string-column [options]` * Update a string column. Changing the 'default' value will not update already existing rows. --- +* `create-text-column [options]` +* Create a text column. +--- +* `update-text-column [options]` +* Update a text column. Changing the 'default' value will not update already existing rows. +--- * `create-url-column [options]` * Create a URL column. --- diff --git a/src/routes/docs/tooling/terraform/resources/webhooks/+page.markdoc b/src/routes/docs/tooling/terraform/resources/webhooks/+page.markdoc index 65dd1e2cda..dcae2f003c 100644 --- a/src/routes/docs/tooling/terraform/resources/webhooks/+page.markdoc +++ b/src/routes/docs/tooling/terraform/resources/webhooks/+page.markdoc @@ -33,7 +33,7 @@ resource "appwrite_webhook" "user_events" { resource "appwrite_webhook" "authenticated" { name = "authenticated webhook" url = "https://api.example.com/webhooks/secure" - events = ["databases.*.collections.*.documents.*.create"] + events = ["tablesdb.*.tables.*.rows.*.create"] auth_username = "webhook" auth_password = var.webhook_password tls = true diff --git a/src/routes/docs/tutorials/nextjs/step-4/+page.markdoc b/src/routes/docs/tutorials/nextjs/step-4/+page.markdoc index 202b4ead8c..db01c4e78e 100644 --- a/src/routes/docs/tutorials/nextjs/step-4/+page.markdoc +++ b/src/routes/docs/tutorials/nextjs/step-4/+page.markdoc @@ -55,7 +55,9 @@ export function useAuth() { }; const logout = async (): Promise<void> => { - await account.deleteSession('current'); + await account.deleteSession({ + sessionId: 'current' + }); setCurrent(null); router.push('/'); }; diff --git a/src/routes/docs/tutorials/nextjs/step-6/+page.markdoc b/src/routes/docs/tutorials/nextjs/step-6/+page.markdoc index db8cb33278..83b947792c 100644 --- a/src/routes/docs/tutorials/nextjs/step-6/+page.markdoc +++ b/src/routes/docs/tutorials/nextjs/step-6/+page.markdoc @@ -78,11 +78,11 @@ export function useIdeas() { // Fetch the 10 most recent ideas from the database const fetch = async (): Promise<void> => { try { - const response = await tablesDB.listRows( + const response = await tablesDB.listRows({ databaseId, tableId, - [Query.orderDesc('$createdAt'), Query.limit(queryLimit)] - ); + queries: [Query.orderDesc('$createdAt'), Query.limit(queryLimit)] + }); setCurrent(response.rows as Idea[]); } catch (error) { console.error('Error fetching ideas:', error); @@ -94,17 +94,17 @@ export function useIdeas() { // Add new idea to the database const add = async (idea: Omit<Idea, '$id' | '$createdAt' | '$updatedAt' | '$permissions'>): Promise<void> => { try { - const response = await tablesDB.createRow( + const response = await tablesDB.createRow({ databaseId, tableId, - ID.unique(), - idea, - [ + rowId: ID.unique(), + data: idea, + permissions: [ Permission.read('any'), Permission.update(`user:${idea.userId}`), Permission.delete(`user:${idea.userId}`) ] - ); + }); setCurrent(prev => [response as Idea, ...prev].slice(0, queryLimit)); } catch (error) { console.error('Error adding idea:', error); @@ -113,7 +113,11 @@ export function useIdeas() { const remove = async (id: string): Promise<void> => { try { - await tablesDB.deleteRow(databaseId, tableId, id); + await tablesDB.deleteRow({ + databaseId, + tableId, + rowId: id + }); await fetch(); // Refetch ideas to ensure we have 10 items } catch (error) { console.error('Error removing idea:', error); @@ -134,4 +138,4 @@ export function useIdeas() { } ``` -Now we can call the `useIdeas()` hook from the home page. \ No newline at end of file +Now we can call the `useIdeas()` hook from the home page. diff --git a/src/routes/integrations/ai-hugging-face-image-classification/+page.markdoc b/src/routes/integrations/ai-hugging-face-image-classification/+page.markdoc index 66db050125..74a0fc658c 100644 --- a/src/routes/integrations/ai-hugging-face-image-classification/+page.markdoc +++ b/src/routes/integrations/ai-hugging-face-image-classification/+page.markdoc @@ -26,7 +26,7 @@ Image classification is a key application of machine learning that involves cate # How does the integration work? -You can utilize a pre-built Appwrite function template to add image classification with Hugging Face to your app. This will allow you to upload an image to an Appwrite storage bucket and store labels from the image in an Appwrite collection. +You can utilize a pre-built Appwrite function template to add image classification with Hugging Face to your app. This will allow you to upload an image to an Appwrite storage bucket and store labels from the image in an Appwrite table. # How to implement @@ -54,13 +54,13 @@ Then, create a new repository with the default branch and root directory setting ## Step 3: Test the function -Once all the steps are complete, it is time to test the function! Use the Appwrite console or one of Appwrite’s SDKs to [upload an image](https://appwrite.io/docs/references/cloud/client-web/storage#createFile) to the `image_classification` storage bucket. If successful, you will find a response saved in the `image_classification` collection in the `ai` database in the following format: +Once all the steps are complete, it is time to test the function! Use the Appwrite console or one of Appwrite’s SDKs to [upload an image](https://appwrite.io/docs/references/cloud/client-web/storage#createFile) to the `image_classification` storage bucket. If successful, you will find a response saved in the `image_classification` table in the `ai` database in the following format: | image | labels | | --- | --- | | `66a13bf100318c752f1b` | `[{"label":"llama","score":0.9664694666862488},{"label":"comic book","score":0.019199883565306664},{"label":"suit, suit of clothes","score":0.005637330934405327},{"label":"television, television system","score":0.00037627643905580044},{"label":"muzzle","score":0.00019786457414738834}]` | -The `image` attribute contains the ID of the image file uploaded to the `image_classification` storage bucket, and the `labels` attribute contains the response from Hugging Face, including all the labels and their confidence score. +The `image` column contains the ID of the image file uploaded to the `image_classification` storage bucket, and the `labels` column contains the response from Hugging Face, including all the labels and their confidence score. # Read more about Hugging Face and Appwrite Functions @@ -72,4 +72,4 @@ If you would like to learn more about Hugging Face and Appwrite Functions, we ha - [Building with Appwrite AI Function templates](https://appwrite.io/blog/post/building-with-ai-function-templates) - [Introducing the Python machine learning runtime](https://appwrite.io/blog/post/introducing-python-machine-learning-runtime) - [Find more function templates](https://appwrite.io/docs/products/functions/templates) -- [Appwrite Functions API reference](https://appwrite.io/docs/references) \ No newline at end of file +- [Appwrite Functions API reference](https://appwrite.io/docs/references) diff --git a/src/routes/integrations/ai-hugging-face-speech-recognition/+page.markdoc b/src/routes/integrations/ai-hugging-face-speech-recognition/+page.markdoc index 05a17f58ff..090c8672cc 100644 --- a/src/routes/integrations/ai-hugging-face-speech-recognition/+page.markdoc +++ b/src/routes/integrations/ai-hugging-face-speech-recognition/+page.markdoc @@ -26,7 +26,7 @@ Speech recognition is a transformative technology that converts spoken language # How does the integration work? -You can utilize a pre-built Appwrite function template to add speech recognition with Hugging Face to your app. This will allow you to upload an audio file to an Appwrite storage bucket and store the recognized speech in an Appwrite collection as text. +You can utilize a pre-built Appwrite function template to add speech recognition with Hugging Face to your app. This will allow you to upload an audio file to an Appwrite storage bucket and store the recognized speech in an Appwrite table as text. # How to implement @@ -54,13 +54,13 @@ Then, create a new repository with the default branch and root directory setting ## Step 3: Test the Function -Once all the steps are complete, it is time to test the function! Use the Appwrite console or one of Appwrite’s SDKs to [upload an audio file](https://appwrite.io/docs/references/cloud/client-web/storage#createFile) to the `speech_recognition` storage bucket. If successful, you will find a response saved in the `speech_recognition` collection in the `ai` database in the following format: +Once all the steps are complete, it is time to test the function! Use the Appwrite console or one of Appwrite’s SDKs to [upload an audio file](https://appwrite.io/docs/references/cloud/client-web/storage#createFile) to the `speech_recognition` storage bucket. If successful, you will find a response saved in the `speech_recognition` table in the `ai` database in the following format: | audio | speech | | --- | --- | | 66a7b386000a1042305c | my thought i have nobody by a beauty and will as you've poured mr rochester is sub and that so don't find simpus and devoted about to at might in a | -The `audio` attribute contains the ID of the audio file uploaded to the `speech_recognition` storage bucket, and the `speech` attribute contains the response from Hugging Face. +The `audio` column contains the ID of the audio file uploaded to the `speech_recognition` storage bucket, and the `speech` column contains the response from Hugging Face. # Read more about Hugging Face and Appwrite Functions @@ -70,4 +70,4 @@ If you would like to learn more about Hugging Face and Appwrite Functions, we ha - [Sign up for Hugging Face](https://huggingface.co/login) - [Set up the Hugging Face provider in Appwrite](https://appwrite.io/docs/products/ai/tutorials/object-detection) - [Find more function templates](https://appwrite.io/docs/products/functions/templates) -- [Appwrite Functions API reference](https://appwrite.io/docs/references) \ No newline at end of file +- [Appwrite Functions API reference](https://appwrite.io/docs/references) diff --git a/src/routes/integrations/lemon-squeezy-payments/+page.markdoc b/src/routes/integrations/lemon-squeezy-payments/+page.markdoc index 50aac51ab8..9244c0d50c 100644 --- a/src/routes/integrations/lemon-squeezy-payments/+page.markdoc +++ b/src/routes/integrations/lemon-squeezy-payments/+page.markdoc @@ -80,7 +80,7 @@ Then, open it in your browser to test the function and access the pre-built inte ![Demo](/images/integrations/lemon-squeezy-payments/demo.avif) -You can visit the **Databases** page in your Appwrite project, enter the `orders` database and the `orders` collection within that, and find your orders. +You can visit the **Databases** page in your Appwrite project, enter the `orders` database and the `orders` table within that, and find your orders. ![Paid orders in database](/images/integrations/lemon-squeezy-payments/database.avif) diff --git a/src/routes/integrations/replication-rxdb/+page.markdoc b/src/routes/integrations/replication-rxdb/+page.markdoc index dc6552c87b..1780b7faef 100644 --- a/src/routes/integrations/replication-rxdb/+page.markdoc +++ b/src/routes/integrations/replication-rxdb/+page.markdoc @@ -31,26 +31,26 @@ To implement the RxDB integration, there are several steps you must complete: ## Step 1: Configure Appwrite project -For this step, you must [create an account on Appwrite Cloud](https://cloud.appwrite.io/register) or [self-host Appwrite](https://appwrite.io/docs/advanced/self-hosting) if you haven’t already. Head over to the Appwrite console, go to the **Settings** page, and copy your project ID and API endpoint for further usage. Next, go to the **Databases** page from the left sidebar, create a new database with the ID `mydb`, and then a collection with the ID `humans` (save both IDs for further usage). +For this step, you must [create an account on Appwrite Cloud](https://cloud.appwrite.io/register) or [self-host Appwrite](https://appwrite.io/docs/advanced/self-hosting) if you haven’t already. Head over to the Appwrite console, go to the **Settings** page, and copy your project ID and API endpoint for further usage. Next, go to the **Databases** page from the left sidebar, create a new database with the ID `mydb`, and then a table with the ID `humans` (save both IDs for further usage). -Click on the **Attributes** tab and add the following attributes (schema used for demo purposes): +Click on the **Columns** tab and add the following columns (schema used for demo purposes): | Key | Type | Size | Required | | --- | --- | --- | --- | -| `name` | String | 100 | Yes | +| `name` | Varchar | 100 | Yes | | `age` | Integer | | Yes | -| `homeAddress` | String | 2000 | Yes | +| `homeAddress` | Text | | Yes | | `deleted` | Boolean | | Yes | -> **Note:** The `deleted` attribute is necessary to add because RxDB only soft deletes to prevent data loss in offline scenarios (no hard deletion of data occurs). +> **Note:** The `deleted` column is necessary to add because RxDB only soft deletes to prevent data loss in offline scenarios (no hard deletion of data occurs). -Then, head to the **Settings** tab of your collection, scroll down to the **Permissions** section, and the following: +Then, head to the **Settings** tab of your table, scroll down to the **Permissions** section, and the following: | Role | Create | Read | Update | Delete | | --- | --- | --- | --- | --- | | Any | Yes | Yes | Yes | Yes | -> **Note:** While RxDB does not allow you to manually configure permissions for each document, if your app uses Appwrite Auth and document-level permissions are enabled for your collection, the Appwrite SDK will automatically assign read and write permissions to the logged-in user for each document created. +> **Note:** While RxDB does not allow you to manually configure permissions for each row, if your app uses Appwrite Auth and row-level permissions are enabled for your table, the Appwrite SDK will automatically assign read and write permissions to the logged-in user for each row created. ## Step 2: Install Appwrite Web SDK and RxDB library @@ -66,7 +66,7 @@ In your app’s `.env` file, add the following: APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1 APPWRITE_PROJECT_ID=your-project-id APPWRITE_DATABASE_ID=your-database-id -APPWRITE_COLLECTION_ID=your-collection-id +APPWRITE_TABLE_ID=your-table-id ``` Then, import all necessary libraries in your code: @@ -134,7 +134,7 @@ await db.addCollections({ const collection = db.humans; ``` -> **Note:** Please ensure that the names of your RxDB database and collection match the IDs of your Appwrite database and collection. +> **Note:** Please ensure that the names of your RxDB database and collection match the IDs of your Appwrite database and table. > ## Step 5: Start replication @@ -146,7 +146,7 @@ const replicationState = replicateAppwrite({ replicationIdentifier: 'my-appwrite-replication', client, databaseId: process.env.APPWRITE_DATABASE_ID, - collectionId: process.env.APPWRITE_COLLECTION_ID, + collectionId: process.env.APPWRITE_TABLE_ID, deletedField: 'deleted', // Field that represents deletion in Appwrite collection, pull: { @@ -173,4 +173,4 @@ If you would like to learn more about RxDB and Appwrite Databases, we have some - [RxDB docs for Appwrite](https://rxdb.info/replication-appwrite.html) - [Appwrite offline sync docs](/docs/products/databases/offline) - [Build an offline-first journal app with RxDB and Appwrite](/blog/post/offline-first-journal) -- [Offline-first journal demo app on GitHub](https://github.com/appwrite-community/offline-journal) \ No newline at end of file +- [Offline-first journal demo app on GitHub](https://github.com/appwrite-community/offline-journal) diff --git a/src/routes/integrations/search-algolia/+page.markdoc b/src/routes/integrations/search-algolia/+page.markdoc index 3d21bffd47..1d077acbad 100644 --- a/src/routes/integrations/search-algolia/+page.markdoc +++ b/src/routes/integrations/search-algolia/+page.markdoc @@ -8,14 +8,14 @@ isPartner: true isNew: false cover: /images/integrations/search-algolia/cover.avif category: search -product: +product: avatar: '/images/integrations/avatars/algolia.avif' vendor: Algolia description: 'Algolia is a search platform that helps you add fast and relevant search capabilities to your app.' -platform: +platform: - 'Self-hosted' - 'Cloud' -images: +images: - /images/integrations/search-algolia/cover.avif - /images/integrations/search-algolia/overview.avif - /images/integrations/search-algolia/index.avif @@ -46,13 +46,13 @@ Then, click on the **Search** page from the left sidebar and **create a new Inde ## Step 2: Create the Appwrite Function -For this step, you must [create an account on Appwrite Cloud](https://cloud.appwrite.io/register) or [self-host Appwrite](https://appwrite.io/docs/advanced/self-hosting) if you haven’t already. In case you decide to self-host Appwrite, there are [additional setup steps](https://appwrite.io/docs/advanced/self-hosting/functions) to use Appwrite Function templates. Additionally, for this template, you must have an Appwrite Database and Collection filled with data in advance. +For this step, you must [create an account on Appwrite Cloud](https://cloud.appwrite.io/register) or [self-host Appwrite](https://appwrite.io/docs/advanced/self-hosting) if you haven’t already. In case you decide to self-host Appwrite, there are [additional setup steps](https://appwrite.io/docs/advanced/self-hosting/functions) to use Appwrite Function templates. Additionally, for this template, you must have an Appwrite database and table filled with data in advance. Head over to the Appwrite console, navigate to the **Functions** page, click the **Templates** tab, and search for the **Algolia** function template. ![Function template](/images/integrations/search-algolia/template.avif) -During the setup process, click on the checkbox to create an Appwrite API key on completion and add the Appwrite Database ID and Collection ID for the data you want to index and search as well as the **Algolia application ID**, **search API key**, **write API key** (under Admin API Key), and **index ID** in the **Variables** step. If you are self-hosting Appwrite, click on the **optional variables** dropdown and update the Appwrite endpoint to your instance’s publicly accessible endpoint. +During the setup process, click on the checkbox to create an Appwrite API key on completion and add the Appwrite database ID and table ID for the data you want to index and search as well as the **Algolia application ID**, **search API key**, **write API key** (under Admin API Key), and **index ID** in the **Variables** step. If you are self-hosting Appwrite, click on the **optional variables** dropdown and update the Appwrite endpoint to your instance’s publicly accessible endpoint. ![Env variables](/images/integrations/search-algolia/variables.avif) @@ -62,16 +62,16 @@ Then, create a new repository with the default branch and root directory setting Once all the steps are complete, it is time to test the function! Before we go further, visit the **Domains** tab on the **Functions** page and copy the domain URL to test the function. -Send a POST (HTTP) Request to the function URL to index the Appwrite Collection in Algolia. +Send a POST (HTTP) Request to the function URL to index the Appwrite table in Algolia. ```bash curl -XPOST https://DEPLOYED_FUNCTION_DOMAIN ``` -In case you have a large collection of data and your function executions timeout, you can head to the **Settings** tab on the **Functions** page and increase the function timeout limit from **15 seconds** to **900 seconds** (maximum). - +In case you have a large table of data and your function executions timeout, you can head to the **Settings** tab on the **Functions** page and increase the function timeout limit from **15 seconds** to **900 seconds** (maximum). + Then, open your function URL in the browser to try the interactive search UI. - + ![Demo](/images/integrations/search-algolia/demo.avif) @@ -81,4 +81,4 @@ If you would like to learn more about Algolia, we have some resources that you s - [Sign up for Algolia](https://dashboard.algolia.com/users/sign_up) - [Learn more about Functions templates in Appwrite docs](https://appwrite.io/docs/products/functions/templates) -- [Connect with other developers and the Appwrite team on Discord.](https://discord.com/invite/appwrite) \ No newline at end of file +- [Connect with other developers and the Appwrite team on Discord.](https://discord.com/invite/appwrite) diff --git a/src/routes/integrations/stripe-payments/+page.markdoc b/src/routes/integrations/stripe-payments/+page.markdoc index 2347b295f0..c4f16263db 100644 --- a/src/routes/integrations/stripe-payments/+page.markdoc +++ b/src/routes/integrations/stripe-payments/+page.markdoc @@ -88,7 +88,7 @@ Then, open it in your browser to test the function and access the pre-built inte ![Demo](/images/integrations/stripe-payments/demo.avif) -You can visit the **Databases** page in your Appwrite project, enter the `orders` database and the `orders` collection within that, and find your orders. +You can visit the **Databases** page in your Appwrite project, enter the `orders` database and the `orders` table within that, and find your orders. ![Appwrite database](/images/integrations/stripe-payments/database.avif) @@ -97,4 +97,4 @@ You can visit the **Databases** page in your Appwrite project, enter the `orders If you would like to learn more about Stripe Payments and Appwrite Functions, we have some resources that you should visit: - [Sign up on Stripe](https://stripe.com) -- [Learn more about Functions templates in Appwrite docs](https://appwrite.io/docs/products/functions/templates) \ No newline at end of file +- [Learn more about Functions templates in Appwrite docs](https://appwrite.io/docs/products/functions/templates) diff --git a/static/bimi.svg b/static/bimi.svg new file mode 100644 index 0000000000..403320b332 --- /dev/null +++ b/static/bimi.svg @@ -0,0 +1,33 @@ +<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny-ps" viewBox="0 0 400 400"> + <title>Appwrite + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/images/blog/anthropic-launches-free-claude-access-for-us-k-12-teachers/cover.avif b/static/images/blog/anthropic-launches-free-claude-access-for-us-k-12-teachers/cover.avif new file mode 100644 index 0000000000..8b3b31d5e5 Binary files /dev/null and b/static/images/blog/anthropic-launches-free-claude-access-for-us-k-12-teachers/cover.avif differ diff --git a/static/images/blog/file-vs-object-vs-block-storage-whats-the-difference/cover.avif b/static/images/blog/file-vs-object-vs-block-storage-whats-the-difference/cover.avif new file mode 100644 index 0000000000..289d8b8557 Binary files /dev/null and b/static/images/blog/file-vs-object-vs-block-storage-whats-the-difference/cover.avif differ diff --git a/static/images/blog/gpt-56-is-here-openais-efficient-frontier-model/cover.avif b/static/images/blog/gpt-56-is-here-openais-efficient-frontier-model/cover.avif new file mode 100644 index 0000000000..c3f75b6d0d Binary files /dev/null and b/static/images/blog/gpt-56-is-here-openais-efficient-frontier-model/cover.avif differ diff --git a/static/images/blog/grok-45-coding-model/cover.avif b/static/images/blog/grok-45-coding-model/cover.avif new file mode 100644 index 0000000000..01f8fb868f Binary files /dev/null and b/static/images/blog/grok-45-coding-model/cover.avif differ diff --git a/static/images/blog/grok-build-open-source/cover.avif b/static/images/blog/grok-build-open-source/cover.avif new file mode 100644 index 0000000000..4820617896 Binary files /dev/null and b/static/images/blog/grok-build-open-source/cover.avif differ diff --git a/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/Appwrite_plugin_for_Claude_Code_is_now_in_the_official_Claude_marketplace.avif b/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/Appwrite_plugin_for_Claude_Code_is_now_in_the_official_Claude_marketplace.avif new file mode 100644 index 0000000000..9accc82f3d Binary files /dev/null and b/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/Appwrite_plugin_for_Claude_Code_is_now_in_the_official_Claude_marketplace.avif differ diff --git a/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/Introducing_the_Appwrite_React_library.avif b/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/Introducing_the_Appwrite_React_library.avif new file mode 100644 index 0000000000..0cec81ba81 Binary files /dev/null and b/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/Introducing_the_Appwrite_React_library.avif differ diff --git a/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/Password_Strength.avif b/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/Password_Strength.avif new file mode 100644 index 0000000000..5a44d2d708 Binary files /dev/null and b/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/Password_Strength.avif differ diff --git a/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/cover.avif b/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/cover.avif new file mode 100644 index 0000000000..a4eeaa7be5 Binary files /dev/null and b/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/cover.avif differ diff --git a/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/introducing_self-serve_baa.avif b/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/introducing_self-serve_baa.avif new file mode 100644 index 0000000000..3f3c3d7589 Binary files /dev/null and b/static/images/blog/june-product-update-react-library-password-strength-baa-and-more/introducing_self-serve_baa.avif differ diff --git a/static/images/blog/what-is-a-storage-bucket/cover.avif b/static/images/blog/what-is-a-storage-bucket/cover.avif new file mode 100644 index 0000000000..1cfdaa5e88 Binary files /dev/null and b/static/images/blog/what-is-a-storage-bucket/cover.avif differ diff --git a/static/images/blog/what-is-cloud-storage-an-expert-guide-for-developers/cover.avif b/static/images/blog/what-is-cloud-storage-an-expert-guide-for-developers/cover.avif new file mode 100644 index 0000000000..cd4136d946 Binary files /dev/null and b/static/images/blog/what-is-cloud-storage-an-expert-guide-for-developers/cover.avif differ diff --git a/static/images/blog/what-is-kubernetes-an-expert-guide-for-developers/cover.avif b/static/images/blog/what-is-kubernetes-an-expert-guide-for-developers/cover.avif new file mode 100644 index 0000000000..eda4d5d156 Binary files /dev/null and b/static/images/blog/what-is-kubernetes-an-expert-guide-for-developers/cover.avif differ diff --git a/static/images/blog/what-is-object-storage-a-beginners-guide/cover.avif b/static/images/blog/what-is-object-storage-a-beginners-guide/cover.avif new file mode 100644 index 0000000000..97e4d45844 Binary files /dev/null and b/static/images/blog/what-is-object-storage-a-beginners-guide/cover.avif differ diff --git a/static/images/blog/what-is-serverless-an-expert-guide-for-developers/cover.avif b/static/images/blog/what-is-serverless-an-expert-guide-for-developers/cover.avif new file mode 100644 index 0000000000..89ef5766bb Binary files /dev/null and b/static/images/blog/what-is-serverless-an-expert-guide-for-developers/cover.avif differ