Skip to content

Commit 9cebf9a

Browse files
committedOct 9, 2024
docs(readme): initial readme
1 parent 5f7fa60 commit 9cebf9a

File tree

4 files changed

+145
-0
lines changed

4 files changed

+145
-0
lines changed
 

‎.github/cover.png

290 KB
Loading

‎CONTRIBUTING.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Contributor Manual
2+
3+
Turso welcomes contributions from the community. This manual provides guidelines for contributing to `libsql-swift` SDK.
4+
5+
https://github.com/firstcontributions/first-contributions
6+
7+
## Prerequisites
8+
9+
## Development
10+
11+
## Running Tests

‎LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Turso (libSQL)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<p align="center">
2+
<a href="https://tur.so/turso-swift">
3+
<picture>
4+
<img src="/.github/cover.png" alt="libSQL Swift" />
5+
</picture>
6+
</a>
7+
<h1 align="center">libSQL Swift</h1>
8+
</p>
9+
10+
<p align="center">
11+
Databases for Swift multi-tenant AI Apps.
12+
</p>
13+
14+
<p align="center">
15+
<a href="https://tur.so/turso-swift"><strong>Turso</strong></a> ·
16+
<a href="https://docs.turso.tech"><strong>Docs</strong></a> ·
17+
<a href="https://docs.turso.tech/sdk/swift/quickstart"><strong>Quickstart</strong></a> ·
18+
<a href="https://docs.turso.tech/sdk/swift/reference"><strong>SDK Reference</strong></a> ·
19+
<a href="https://turso.tech/blog"><strong>Blog &amp; Tutorials</strong></a>
20+
</p>
21+
22+
<p align="center">
23+
<a href="LICENSE">
24+
<picture>
25+
<img src="https://img.shields.io/github/license/tursodatabase/libsql-swift?color=0F624B" alt="MIT License" />
26+
</picture>
27+
</a>
28+
<a href="https://tur.so/discord-swift">
29+
<picture>
30+
<img src="https://img.shields.io/discord/933071162680958986?color=0F624B" alt="Discord" />
31+
</picture>
32+
</a>
33+
<a href="#contributors">
34+
<picture>
35+
<img src="https://img.shields.io/github/contributors/tursodatabase/libsql-swift?color=0F624B" alt="Contributors" />
36+
</picture>
37+
</a>
38+
<a href="/examples">
39+
<picture>
40+
<img src="https://img.shields.io/badge/browse-examples-0F624B" alt="Examples" />
41+
</picture>
42+
</a>
43+
</p>
44+
45+
## Features
46+
47+
- 🔌 Works offline with [Embedded Replicas](https://docs.turso.tech/features/embedded-replicas/introduction)
48+
- 🌎 Works with remote Turso databases
49+
- ✨ Works with Turso [AI & Vector Search](https://docs.turso.tech/features/ai-and-embeddings)
50+
- 📱 Works with macOS, iPadOS, tvOS, watchOS & iOS
51+
52+
## Install
53+
54+
Add `tursodatabase/libsql-swift` to your SwiftPM dependencies:
55+
56+
```swift
57+
import PackageDescription
58+
59+
let package = Package(
60+
// ...
61+
dependencies: [
62+
.package(url: "https://github.com/tursodatabase/libsql-swift", from: "0.1.1"),
63+
],
64+
// ...
65+
)
66+
```
67+
68+
## Quickstart
69+
70+
The example below uses Embedded Replicas and syncs data every 1000ms from Turso.
71+
72+
```swift
73+
import Libsql
74+
75+
let db = try Libsql.Database(
76+
path: "./local.db",
77+
url: "TURSO_DATABASE_URL",
78+
authToken: "TURSO_AUTH_TOKEN",
79+
syncInterval: 1000
80+
)
81+
82+
let conn = try db.connect()
83+
84+
try conn.execute("
85+
CREATE TABLE IF NOT EXISTS users (
86+
id INTEGER PRIMARY KEY AUTOINCREMENT,
87+
name TEXT
88+
);
89+
INSERT INTO users (name) VALUES ('Iku');
90+
")
91+
92+
try conn.query("SELECT * FROM users WHERE id = ?", 1)
93+
```
94+
95+
## Documentation
96+
97+
Visit our [official documentation](https://docs.turso.tech/sdk/swift).
98+
99+
## Support
100+
101+
Join us [on Discord](https://tur.so/discord-swift) to get help using this SDK. Report security issues [via email](mailto:security@turso.tech).
102+
103+
## Contributors
104+
105+
See the [contributing guide](CONTRIBUTING.md) to learn how to get involved.
106+
107+
![Contributors](https://contrib.nn.ci/api?repo=tursodatabase/libsql-swift)
108+
109+
<a href="https://github.com/tursodatabase/libsql-swift/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22">
110+
<picture>
111+
<img src="https://img.shields.io/github/issues-search/tursodatabase/libsql-swift?label=good%20first%20issue&query=label%3A%22good%20first%20issue%22%20&color=0F624B" alt="good first issue" />
112+
</picture>
113+
</a>

0 commit comments

Comments
 (0)
Please sign in to comment.