Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-kotlin.svg?color=green&style=flat-square)
![License](https://img.shields.io/github/license/appwrite/sdk-for-kotlin.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square)
[![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-kotlin/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-kotlin/releases).**

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

Expand Down Expand Up @@ -39,7 +39,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:

```groovy
implementation("io.appwrite:sdk-for-kotlin:9.1.2")
implementation("io.appwrite:sdk-for-kotlin:10.0.0")
```

### Maven
Expand All @@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
<dependency>
<groupId>io.appwrite</groupId>
<artifactId>sdk-for-kotlin</artifactId>
<version>9.1.2</version>
<version>10.0.0</version>
</dependency>
</dependencies>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.appwrite.services.Databases;
Client client = new 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
.setSession(""); // The user session to authenticate with

Databases databases = new Databases(client);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.appwrite.services.Databases;
Client client = new 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
.setSession(""); // The user session to authenticate with

Databases databases = new Databases(client);

Expand Down
28 changes: 28 additions & 0 deletions docs/examples/java/tablesdb/create-boolean-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDb;

Client client = new 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 = new TablesDb(client);

tablesDb.createBooleanColumn(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
"", // key
false, // required
false, // default (optional)
false, // array (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

28 changes: 28 additions & 0 deletions docs/examples/java/tablesdb/create-datetime-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDb;

Client client = new 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 = new TablesDb(client);

tablesDb.createDatetimeColumn(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
"", // key
false, // required
"", // default (optional)
false, // array (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

28 changes: 28 additions & 0 deletions docs/examples/java/tablesdb/create-email-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDb;

Client client = new 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 = new TablesDb(client);

tablesDb.createEmailColumn(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
"", // key
false, // required
"[email protected]", // default (optional)
false, // array (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

29 changes: 29 additions & 0 deletions docs/examples/java/tablesdb/create-enum-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDb;

Client client = new 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 = new TablesDb(client);

tablesDb.createEnumColumn(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
"", // key
listOf(), // elements
false, // required
"<DEFAULT>", // default (optional)
false, // array (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

30 changes: 30 additions & 0 deletions docs/examples/java/tablesdb/create-float-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDb;

Client client = new 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 = new TablesDb(client);

tablesDb.createFloatColumn(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
"", // key
false, // required
0, // min (optional)
0, // max (optional)
0, // default (optional)
false, // array (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

30 changes: 30 additions & 0 deletions docs/examples/java/tablesdb/create-index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDb;
import io.appwrite.enums.IndexType;

Client client = new 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 = new TablesDb(client);

tablesDb.createIndex(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
"", // key
IndexType.KEY, // type
listOf(), // columns
listOf(), // orders (optional)
listOf(), // lengths (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

30 changes: 30 additions & 0 deletions docs/examples/java/tablesdb/create-integer-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDb;

Client client = new 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 = new TablesDb(client);

tablesDb.createIntegerColumn(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
"", // key
false, // required
0, // min (optional)
0, // max (optional)
0, // default (optional)
false, // array (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

28 changes: 28 additions & 0 deletions docs/examples/java/tablesdb/create-ip-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDb;

Client client = new 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 = new TablesDb(client);

tablesDb.createIpColumn(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
"", // key
false, // required
"", // default (optional)
false, // array (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

31 changes: 31 additions & 0 deletions docs/examples/java/tablesdb/create-relationship-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDb;
import io.appwrite.enums.RelationshipType;

Client client = new 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 = new TablesDb(client);

tablesDb.createRelationshipColumn(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
"<RELATED_TABLE_ID>", // relatedTableId
RelationshipType.ONETOONE, // type
false, // twoWay (optional)
"", // key (optional)
"", // twoWayKey (optional)
RelationMutate.CASCADE, // onDelete (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

27 changes: 27 additions & 0 deletions docs/examples/java/tablesdb/create-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDb;

Client client = new 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 = new TablesDb(client);

tablesDb.createRow(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
"<ROW_ID>", // rowId
mapOf( "a" to "b" ), // data
listOf("read("any")"), // permissions (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

25 changes: 25 additions & 0 deletions docs/examples/java/tablesdb/create-rows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDb;

Client client = new 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 = new TablesDb(client);

tablesDb.createRows(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
listOf(), // rows
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

Loading