Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tursodatabase/libsql-swift
libSQL bindings for Swift
https://github.com/tursodatabase/libsql-swift
Last synced: 3 days ago
JSON representation
libSQL bindings for Swift
- Host: GitHub
- URL: https://github.com/tursodatabase/libsql-swift
- Owner: tursodatabase
- License: mit
- Created: 2024-08-23T12:32:46.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-21T13:30:12.000Z (22 days ago)
- Last Synced: 2024-10-21T21:44:29.973Z (22 days ago)
- Language: C
- Size: 88.8 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
libSQL Swift
Databases for Swift multi-tenant AI Apps.
Turso ยท
Docs ยท
Quickstart ยท
SDK Reference ยท
Blog & Tutorials## Features
- ๐ Works offline with [Embedded Replicas](https://docs.turso.tech/features/embedded-replicas/introduction)
- ๐ Works with remote Turso databases
- โจ Works with Turso [AI & Vector Search](https://docs.turso.tech/features/ai-and-embeddings)
- ๐ฑ Works with macOS, iPadOS, tvOS, watchOS & iOS> [!WARNING]
> This SDK is currently in technical preview. Join us in Discord to report any issues.## Install
Add `tursodatabase/libsql-swift` to your SwiftPM dependencies:
```swift
import PackageDescriptionlet package = Package(
// ...
dependencies: [
.package(url: "https://github.com/tursodatabase/libsql-swift", from: "0.1.1"),
],
// ...
)
```## Quickstart
The example below uses Embedded Replicas and syncs data every 1000ms from Turso.
```swift
import Libsqllet db = try Database(
path: "./local.db",
url: "TURSO_DATABASE_URL",
authToken: "TURSO_AUTH_TOKEN",
syncInterval: 1000
)let conn = try db.connect()
try conn.execute("
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT
);
INSERT INTO users (name) VALUES ('Iku');
")try conn.query("SELECT * FROM users WHERE id = ?", 1)
```## Documentation
Visit our [official documentation](https://docs.turso.tech/sdk/swift).
## Support
Join us [on Discord](https://tur.so/discord-swift) to get help using this SDK. Report security issues [via email](mailto:[email protected]).
## Contributors
See the [contributing guide](CONTRIBUTING.md) to learn how to get involved.
![Contributors](https://contrib.nn.ci/api?repo=tursodatabase/libsql-swift)