https://github.com/sqlitecloud/sqlitecloud-kotlin
SQLite Cloud Kotlin SDK
https://github.com/sqlitecloud/sqlitecloud-kotlin
Last synced: 7 months ago
JSON representation
SQLite Cloud Kotlin SDK
- Host: GitHub
- URL: https://github.com/sqlitecloud/sqlitecloud-kotlin
- Owner: sqlitecloud
- License: mit
- Created: 2023-10-03T06:02:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-25T11:24:24.000Z (10 months ago)
- Last Synced: 2025-02-25T11:50:35.286Z (10 months ago)
- Language: C
- Size: 5.53 MB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# SQLiteCloud Kotlin Library

SQLiteCloud is a powerful Kotlin library that allows you to interact with the SQLite Cloud backend server seamlessly. It provides methods for various database operations and real-time notifications. This package is designed to simplify database operations in Android applications, making it easier than ever to work with SQLite Cloud.
## Features
- **Database Operations**: Easily perform database operations, including queries, updates, inserts, and more.
- **Real-time Notifications**: Get real-time notifications from the SQLite Cloud backend server.
- **Efficient**: SQLiteCloud is designed for efficiency, ensuring that your database operations are fast and reliable.
## Installation
You can install the SQLiteCloud Kotlin library by downloading this repository and adding the `sqlitecloud` module into your project (for example, if you're using Android Studio, place the `sqlitecloud` directory within your project's root directory, select the menu `File > New > Import Module...` and select such directory). Then, in your project's `build.gradle`, add the following line to the `dependencies` section:
```
implementation(project(mapOf("path" to ":sqlitecloud")))
```
## Usage
#### Using explicit configuration
```kotlin
val configuration = SQLiteCloudConfig(hostname = "myproject.sqlite.cloud", username = "", password = "")
val sqliteCloud = SQLiteCloud(appContext = applicationContext, config = configuration)
myCoroutineScope.launch {
val result = try {
sqliteCloud.connect()
"connected"
} catch (e: SQLiteCloudError) {
"connection error: ${e.message ?: "unknown error"}"
}
Log.d("MyTag", result)
}
```
#### Using string configuration
```kotlin
let configuration = SQLiteCloudConfig.fromString("sqlitecloud://user:pass@host.com:port/dbname?timeout=10&key2=value2&key3=value3")
val sqliteCloud = SQLiteCloud(appContext = applicationContext, config = configuration)
myCoroutineScope.launch {
val result = try {
sqliteCloud.connect()
"connected"
} catch (e: SQLiteCloudError) {
"connection error: ${e.message ?: "unknown error"}"
}
Log.d("MyTag", result)
}
```
## License
SQLiteCloud is licensed under the MIT License. See the LICENSE file for details.