Skip to content

Commit b08b6c0

Browse files
committed
Update grids to tablesDb
1 parent 5b58df3 commit b08b6c0

File tree

46 files changed

+659
-659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+659
-659
lines changed

src/routes/docs/advanced/platform/permissions/+page.markdoc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ The following examples are using the [Appwrite Web SDK](https://github.com/appwr
6868
In the following example, we are creating a row that can be read by anyone, edited by writers or admins, and deleted by administrators or a user with the user ID `user:5c1f88b42259e`.
6969

7070
```client-web
71-
import { Client, Grids, Permission, Role } from "appwrite";
71+
import { Client, TablesDb, Permission, Role } from "appwrite";
7272

7373
const client = new Client()
7474
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
7575
.setProject('<PROJECT_ID>');
7676

77-
const grids = new Grids(client);
77+
const tablesDb = new TablesDb(client);
7878

79-
let promise = grids.createRow(
79+
let promise = tablesDb.createRow(
8080
'<DATABASE_ID>',
8181
'<TABLE_ID>',
8282
{'actorName': 'Chris Evans', 'height': 183},
@@ -101,15 +101,15 @@ promise.then(function (response) {
101101
In the following example, we are creating a row that can be read by members of the team with ID `5c1f88b87435e` and can only be edited or deleted by members of the same team that possess the team role `owner`.
102102

103103
```client-web
104-
import { Client, Grids, Permission, Role } from "appwrite";
104+
import { Client, TablesDb, Permission, Role } from "appwrite";
105105

106106
const client = new Client()
107107
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
108108
.setProject('<PROJECT_ID>');
109109

110-
const grids = new Grids(client);
110+
const tablesDb = new TablesDb(client);
111111

112-
let promise = grids.createRow(
112+
let promise = tablesDb.createRow(
113113
'<DATABASE_ID>',
114114
'<TABLE_ID>',
115115
{'actorName': 'Chris Evans', 'height': 183},
@@ -147,15 +147,15 @@ When creating rows in your application, set row-level permissions to restrict ac
147147

148148
{% multicode %}
149149
```client-web
150-
import { Client, Grids, Permission, Role } from "appwrite";
150+
import { Client, TablesDb, Permission, Role } from "appwrite";
151151

152152
const client = new Client()
153153
.setEndpoint('https://cloud.appwrite.io/v1')
154154
.setProject('<PROJECT_ID>');
155155

156-
const grids = new Grids(client);
156+
const tablesDb = new TablesDb(client);
157157

158-
let promise = grids.createRow(
158+
let promise = tablesDb.createRow(
159159
'<DATABASE_ID>',
160160
'<TABLE_ID>',
161161
{ 'title': 'My Private Row' },
@@ -180,10 +180,10 @@ void main() async {
180180
.setEndpoint('https://cloud.appwrite.io/v1')
181181
.setProject('<PROJECT_ID>');
182182

183-
final grids = Grids(client);
183+
final tablesDb = TablesDb(client);
184184

185185
try {
186-
final row = await grids.createRow(
186+
final row = await tablesDb.createRow(
187187
databaseId: '<DATABASE_ID>',
188188
tableId: '<TABLE_ID>',
189189
data: { 'title': 'My Private Row' },
@@ -206,10 +206,10 @@ func main() async throws {
206206
.setEndpoint("https://cloud.appwrite.io/v1")
207207
.setProject("<PROJECT_ID>");
208208

209-
let grids = Grids(client);
209+
let tablesDb = TablesDb(client);
210210

211211
do {
212-
let row = try await grids.createRow(
212+
let row = try await tablesDb.createRow(
213213
databaseId: "<DATABASE_ID>",
214214
tableId: "<TABLE_ID>",
215215
data: ["title": "My Private Row"],
@@ -228,18 +228,18 @@ func main() async throws {
228228
import io.appwrite.Client
229229
import io.appwrite.Permission
230230
import io.appwrite.Role
231-
import io.appwrite.services.Databases
231+
import io.appwrite.services.TablesDb
232232
import io.appwrite.exceptions.AppwriteException
233233

234234
suspend fun main() {
235235
val client = Client(applicationContext)
236236
.setEndpoint("https://cloud.appwrite.io/v1")
237237
.setProject("<PROJECT_ID>");
238238

239-
val grids = Grids(client);
239+
val tablesDb = TablesDb(client);
240240

241241
try {
242-
val row = grids.createRow(
242+
val row = tablesDb.createRow(
243243
databaseId = "<DATABASE_ID>",
244244
tableId = "<TABLE_ID>",
245245
data = mapOf("title" to "My Private Row"),

src/routes/docs/products/ai/integrations/langchain/+page.markdoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ This code will handle the prompt requests by creating a LangChain sequence that
255255
The Appwrite table needs to be indexed into the Pinecone index. Create a new file at `src/appwrite.js` with the following code:
256256

257257
```js
258-
import { Client, Grids, Query } from 'node-appwrite';
258+
import { Client, TablesDb, Query } from 'node-appwrite';
259259

260260
export default class AppwriteService {
261261
constructor() {
@@ -267,7 +267,7 @@ export default class AppwriteService {
267267
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
268268
.setKey(process.env.APPWRITE_API_KEY);
269269

270-
this.grids = new Grids(client);
270+
this.tablesDb = new TablesDb(client);
271271
}
272272

273273
async getAllRows(databaseId, tableId) {
@@ -281,7 +281,7 @@ export default class AppwriteService {
281281
queries.push(Query.cursorAfter(cursor));
282282
}
283283

284-
const { rows } = await this.grids.listRows(
284+
const { rows } = await this.tablesDb.listRows(
285285
databaseId,
286286
tableId,
287287
queries

src/routes/docs/products/ai/integrations/pinecone/+page.markdoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ For all requests with the path `/search`, the function sends the search query to
224224
The Appwrite table needs to be indexed into the Pinecone index. Create a new file at `src/appwrite.js` with the following code:
225225

226226
```js
227-
import { Client, Grids, Query } from 'node-appwrite';
227+
import { Client, TablesDb, Query } from 'node-appwrite';
228228

229229
export default class AppwriteService {
230230
constructor() {
@@ -236,7 +236,7 @@ export default class AppwriteService {
236236
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
237237
.setKey(process.env.APPWRITE_API_KEY);
238238

239-
this.grids = new Grids(client);
239+
this.tablesDb = new TablesDb(client);
240240
}
241241

242242
async getAllRows(databaseId, tableId) {
@@ -250,7 +250,7 @@ export default class AppwriteService {
250250
queries.push(Query.cursorAfter(cursor));
251251
}
252252

253-
const { rows } = await this.grids.listRows(
253+
const { rows } = await this.tablesDb.listRows(
254254
databaseId,
255255
tableId,
256256
queries

src/routes/docs/products/ai/tutorials/image-classification/+page.markdoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ With the payload parsed, now you can download the image from Appwrite Storage.
112112
Create a new file called `appwrite.js` in the `src` directory and add the following code:
113113

114114
```js
115-
import { Client, Grids, ID, Storage } from 'node-appwrite';
115+
import { Client, TablesDb, ID, Storage } from 'node-appwrite';
116116

117117
class AppwriteService {
118118
constructor() {
@@ -124,7 +124,7 @@ class AppwriteService {
124124
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
125125
.setKey(process.env.APPWRITE_API_KEY);
126126

127-
this.grids = new Grids(client);
127+
this.tablesDb = new TablesDb(client);
128128
this.storage = new Storage(client);
129129
}
130130

@@ -185,7 +185,7 @@ To begin, add a new function to the `appwrite.js` file created earlier which wil
185185
```js
186186
async createImageLabels(databaseId, tableId, imageId, labels)
187187
{
188-
await this.grids.createRow(
188+
await this.tablesDb.createRow(
189189
databaseId,
190190
tableId,
191191
ID.unique(),

src/routes/docs/products/ai/tutorials/music-generation/+page.markdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class AppwriteService {
6565
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
6666
.setKey(process.env.APPWRITE_API_KEY);
6767

68-
this.grids = new Grids(client);
68+
this.tablesDb = new TablesDb(client);
6969
this.storage = new Storage(client);
7070
}
7171

src/routes/docs/products/ai/tutorials/object-detection/+page.markdoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ With the payload parsed, you can now download the image from the Appwrite Storag
9595
Create a new file in the `src` directory called `appwrite.js` and add the following code:
9696

9797
```js
98-
import { Client, Grids, ID, Storage } from 'node-appwrite';
98+
import { Client, TablesDb, ID, Storage } from 'node-appwrite';
9999

100100
class AppwriteService {
101101
constructor() {
@@ -107,7 +107,7 @@ class AppwriteService {
107107
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
108108
.setKey(process.env.APPWRITE_API_KEY);
109109

110-
this.grids = new Grids(client);
110+
this.tablesDb = new TablesDb(client);
111111
this.storage = new Storage(client);
112112
}
113113

@@ -186,7 +186,7 @@ To begin with we're going to add a new function to the `appwrite.js` file we cre
186186
```js
187187
async createImageLabels(databaseId, tableId, imageId, labels)
188188
{
189-
await this.grids.createRow(
189+
await this.tablesDb.createRow(
190190
databaseId,
191191
tableId,
192192
ID.unique(),

src/routes/docs/products/ai/tutorials/speech-recognition/+page.markdoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ To make this easier, create a service class that will handle all the Appwrite in
5050
Create a file called `src/appwrite.js` and implement the following class:
5151

5252
```js
53-
import { Client, Grids, ID, Storage } from 'node-appwrite';
53+
import { Client, TablesDb, ID, Storage } from 'node-appwrite';
5454

5555
class AppwriteService {
5656
constructor() {
@@ -62,12 +62,12 @@ class AppwriteService {
6262
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
6363
.setKey(process.env.APPWRITE_API_KEY);
6464

65-
this.grids = new Grids(client);
65+
this.tablesDb = new TablesDb(client);
6666
this.storage = new Storage(client);
6767
}
6868

6969
async createRecognitionEntry(databaseId, tableId, audioId, speech) {
70-
await this.grids.createRow(
70+
await this.tablesDb.createRow(
7171
databaseId,
7272
tableId,
7373
ID.unique(),

0 commit comments

Comments
 (0)