Skip to content

Commit 3085659

Browse files
authored
Merge pull request #114 from appwrite/dev
feat: Android SDK update for version 13.0.0
2 parents f707900 + 7bf4281 commit 3085659

13 files changed

Lines changed: 43 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Change Log
22

3-
## 12.2.0
3+
## 13.0.0
44

5-
* Added Channel<_Document>.upsert() and Channel<_Row>.upsert() API methods to upsert documents and rows in channels.
6-
* Added new query filters: containsAny(attribute, List<Any>) and containsAll(attribute, List<Any>) for advanced matching on array/relationship attributes.
7-
* Realtime improvements: improved WebSocket lifecycle and connection handling. Introduced generation-based checks to avoid processing messages from stale sockets and ensure sequential socket recreation on reconnects.
5+
* Breaking: Channel factory methods require explicit IDs (no wildcard defaults)
6+
* Added ttl parameter to listDocuments and listRows for caching
7+
* Updated x-sdk-version header to 12.2.1 in Client
8+
* Updated docs and examples to show TTL usage and latest compatibility note
9+
* Updated Document and Row sequence descriptions in models
810

911
## 12.1.0
1012

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
88
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
99

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

1212
Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Android SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1313

@@ -38,7 +38,7 @@ repositories {
3838
Next, add the dependency to your project's `build.gradle(.kts)` file:
3939

4040
```groovy
41-
implementation("io.appwrite:sdk-for-android:12.2.0")
41+
implementation("io.appwrite:sdk-for-android:13.0.0")
4242
```
4343

4444
### Maven
@@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
4949
<dependency>
5050
<groupId>io.appwrite</groupId>
5151
<artifactId>sdk-for-android</artifactId>
52-
<version>12.2.0</version>
52+
<version>13.0.0</version>
5353
</dependency>
5454
</dependencies>
5555
```

docs/examples/java/databases/list-documents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ databases.listDocuments(
1515
List.of(), // queries (optional)
1616
"<TRANSACTION_ID>", // transactionId (optional)
1717
false, // total (optional)
18+
0, // ttl (optional)
1819
new CoroutineCallback<>((result, error) -> {
1920
if (error != null) {
2021
error.printStackTrace();

docs/examples/java/tablesdb/list-rows.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ tablesDB.listRows(
1515
List.of(), // queries (optional)
1616
"<TRANSACTION_ID>", // transactionId (optional)
1717
false, // total (optional)
18+
0, // ttl (optional)
1819
new CoroutineCallback<>((result, error) -> {
1920
if (error != null) {
2021
error.printStackTrace();

docs/examples/kotlin/databases/list-documents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ val result = databases.listDocuments(
1515
queries = listOf(), // (optional)
1616
transactionId = "<TRANSACTION_ID>", // (optional)
1717
total = false, // (optional)
18+
ttl = 0, // (optional)
1819
)
1920
```

docs/examples/kotlin/tablesdb/list-rows.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ val result = tablesDB.listRows(
1515
queries = listOf(), // (optional)
1616
transactionId = "<TRANSACTION_ID>", // (optional)
1717
total = false, // (optional)
18+
ttl = 0, // (optional)
1819
)
1920
```

library/src/main/java/io/appwrite/Channel.kt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ typealias Actionable = _Document
2424
*/
2525
private fun normalize(id: String): String {
2626
val trimmed = id.trim()
27-
return if (trimmed.isEmpty()) "*" else trimmed
27+
require(trimmed.isNotEmpty()) { "Channel ID is required." }
28+
return trimmed
2829
}
2930

3031
/**
@@ -59,25 +60,25 @@ class Channel<out T> private constructor(
5960
override fun toString(): String = segments.joinToString(".")
6061

6162
companion object {
62-
fun database(id: String = "*"): Channel<_Database> =
63+
fun database(id: String): Channel<_Database> =
6364
Channel(listOf("databases", normalize(id)))
6465

65-
fun tablesdb(id: String = "*"): Channel<_TablesDB> =
66+
fun tablesdb(id: String): Channel<_TablesDB> =
6667
Channel(listOf("tablesdb", normalize(id)))
6768

68-
fun bucket(id: String = "*"): Channel<_Bucket> =
69+
fun bucket(id: String): Channel<_Bucket> =
6970
Channel(listOf("buckets", normalize(id)))
7071

71-
fun execution(id: String = "*"): Channel<_Execution> =
72+
fun execution(id: String): Channel<_Execution> =
7273
Channel(listOf("executions", normalize(id)))
7374

74-
fun function(id: String = "*"): Channel<_Func> =
75+
fun function(id: String): Channel<_Func> =
7576
Channel(listOf("functions", normalize(id)))
7677

77-
fun team(id: String = "*"): Channel<_Team> =
78+
fun team(id: String): Channel<_Team> =
7879
Channel(listOf("teams", normalize(id)))
7980

80-
fun membership(id: String = "*"): Channel<_Membership> =
81+
fun membership(id: String): Channel<_Membership> =
8182
Channel(listOf("memberships", normalize(id)))
8283

8384
fun account(): String = "account"
@@ -98,8 +99,8 @@ class Channel<out T> private constructor(
9899
/**
99100
* Only available on Channel<_Database>
100101
*/
101-
fun Channel<_Database>.collection(id: String? = null): Channel<_Collection> =
102-
this.next("collections", id ?: "*")
102+
fun Channel<_Database>.collection(id: String): Channel<_Collection> =
103+
this.next("collections", id)
103104

104105
/**
105106
* Only available on Channel<_Collection>
@@ -112,8 +113,8 @@ fun Channel<_Collection>.document(id: String? = null): Channel<_Document> =
112113
/**
113114
* Only available on Channel<_TablesDB>
114115
*/
115-
fun Channel<_TablesDB>.table(id: String? = null): Channel<_Table> =
116-
this.next("tables", id ?: "*")
116+
fun Channel<_TablesDB>.table(id: String): Channel<_Table> =
117+
this.next("tables", id)
117118

118119
/**
119120
* Only available on Channel<_Table>

library/src/main/java/io/appwrite/Client.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Client @JvmOverloads constructor(
8787
"x-sdk-name" to "Android",
8888
"x-sdk-platform" to "client",
8989
"x-sdk-language" to "android",
90-
"x-sdk-version" to "12.2.0",
90+
"x-sdk-version" to "13.0.0",
9191
"x-appwrite-response-format" to "1.8.0"
9292
)
9393
config = mutableMapOf()

library/src/main/java/io/appwrite/models/Document.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ data class Document<T>(
1414
val id: String,
1515

1616
/**
17-
* Document automatically incrementing ID.
17+
* Document sequence ID.
1818
*/
1919
@SerializedName("\$sequence")
2020
val sequence: Long,

library/src/main/java/io/appwrite/models/Row.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ data class Row<T>(
1414
val id: String,
1515

1616
/**
17-
* Row automatically incrementing ID.
17+
* Row sequence ID.
1818
*/
1919
@SerializedName("\$sequence")
2020
val sequence: Long,

0 commit comments

Comments
 (0)