Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

[![pub package](https://img.shields.io/pub/v/dart_appwrite.svg?style=flat-square)](https://pub.dartlang.org/packages/dart_appwrite)
![License](https://img.shields.io/github/license/appwrite/sdk-for-dart.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.7.x-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.8.x-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dart/releases).**
**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dart/releases).**

> This is the Dart SDK for integrating with Appwrite from your Dart server-side code. If you're looking for the Flutter SDK you should check [appwrite/sdk-for-flutter](https://github.com/appwrite/sdk-for-flutter)

Expand All @@ -23,7 +23,7 @@ Add this to your package's `pubspec.yaml` file:

```yml
dependencies:
dart_appwrite: ^16.2.0
dart_appwrite: ^17.0.0
```

You can install packages from the command line:
Expand Down
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:lints/recommended.yaml
1 change: 1 addition & 0 deletions docs/examples/databases/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Database result = await databases.create(
databaseId: '<DATABASE_ID>',
name: '<NAME>',
enabled: false, // (optional)
type: .tablesdb, // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/functions/create-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Execution result = await functions.createExecution(
path: '<PATH>', // (optional)
method: ExecutionMethod.gET, // (optional)
headers: {}, // (optional)
scheduledAt: '', // (optional)
scheduledAt: '<SCHEDULED_AT>', // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/tablesdb/create-boolean-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

ColumnBoolean result = await tablesDb.createBooleanColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: false, // (optional)
array: false, // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/tablesdb/create-datetime-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

ColumnDatetime result = await tablesDb.createDatetimeColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: '', // (optional)
array: false, // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/tablesdb/create-email-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

ColumnEmail result = await tablesDb.createEmailColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: 'email@example.com', // (optional)
array: false, // (optional)
);
18 changes: 18 additions & 0 deletions docs/examples/tablesdb/create-enum-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

ColumnEnum result = await tablesDb.createEnumColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
elements: [],
xrequired: false,
xdefault: '<DEFAULT>', // (optional)
array: false, // (optional)
);
19 changes: 19 additions & 0 deletions docs/examples/tablesdb/create-float-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

ColumnFloat result = await tablesDb.createFloatColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
min: 0, // (optional)
max: 0, // (optional)
xdefault: 0, // (optional)
array: false, // (optional)
);
18 changes: 18 additions & 0 deletions docs/examples/tablesdb/create-index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

ColumnIndex result = await tablesDb.createIndex(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
type: IndexType.key,
columns: [],
orders: [], // (optional)
lengths: [], // (optional)
);
19 changes: 19 additions & 0 deletions docs/examples/tablesdb/create-integer-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

ColumnInteger result = await tablesDb.createIntegerColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
min: 0, // (optional)
max: 0, // (optional)
xdefault: 0, // (optional)
array: false, // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/tablesdb/create-ip-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

ColumnIp result = await tablesDb.createIpColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: '', // (optional)
array: false, // (optional)
);
19 changes: 19 additions & 0 deletions docs/examples/tablesdb/create-relationship-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

ColumnRelationship result = await tablesDb.createRelationshipColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
relatedTableId: '<RELATED_TABLE_ID>',
type: RelationshipType.oneToOne,
twoWay: false, // (optional)
key: '', // (optional)
twoWayKey: '', // (optional)
onDelete: RelationMutate.cascade, // (optional)
);
16 changes: 16 additions & 0 deletions docs/examples/tablesdb/create-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

TablesDb tablesDb = TablesDb(client);

Row result = await tablesDb.createRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
data: {},
permissions: ["read("any")"], // (optional)
);
14 changes: 14 additions & 0 deletions docs/examples/tablesdb/create-rows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

RowList result = await tablesDb.createRows(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rows: [],
);
19 changes: 19 additions & 0 deletions docs/examples/tablesdb/create-string-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

ColumnString result = await tablesDb.createStringColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
size: 1,
xrequired: false,
xdefault: '<DEFAULT>', // (optional)
array: false, // (optional)
encrypt: false, // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/tablesdb/create-table.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

Table result = await tablesDb.createTable(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
name: '<NAME>',
permissions: ["read("any")"], // (optional)
rowSecurity: false, // (optional)
enabled: false, // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/tablesdb/create-url-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

ColumnUrl result = await tablesDb.createUrlColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: 'https://example.com', // (optional)
array: false, // (optional)
);
15 changes: 15 additions & 0 deletions docs/examples/tablesdb/create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

Database result = await tablesDb.create(
databaseId: '<DATABASE_ID>',
name: '<NAME>',
enabled: false, // (optional)
type: .tablesdb, // (optional)
);
17 changes: 17 additions & 0 deletions docs/examples/tablesdb/decrement-row-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

Row result = await tablesDb.decrementRowColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
column: '',
value: 0, // (optional)
min: 0, // (optional)
);
14 changes: 14 additions & 0 deletions docs/examples/tablesdb/delete-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

await tablesDb.deleteColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
);
14 changes: 14 additions & 0 deletions docs/examples/tablesdb/delete-index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

await tablesDb.deleteIndex(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
);
14 changes: 14 additions & 0 deletions docs/examples/tablesdb/delete-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

TablesDb tablesDb = TablesDb(client);

await tablesDb.deleteRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
);
14 changes: 14 additions & 0 deletions docs/examples/tablesdb/delete-rows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:dart_appwrite/dart_appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

TablesDb tablesDb = TablesDb(client);

await tablesDb.deleteRows(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
queries: [], // (optional)
);
Loading