Skip to content

Commit

Permalink
docs: readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
krizzu committed Feb 22, 2024
1 parent e3b2eed commit 2aa433c
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
python-version: 3.11
- name: Install MkDocs
run: pip install mkdocs==1.5.3 mkdocs-material==9.5.10
- name: Copy changelog
run: |
cp CHANGELOG.md docs/changelog.md
- name: Build docs
run: mkdocs build
- name: Deploy docs
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ android/keystores/debug.keystore

# Built website
site/
docs/changelog.md
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## [0.1.0] - 2024-XX-XX

Initial release.
49 changes: 45 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Async Storage SQLite

Multiplatform native wrapper of SQLite for React Native Async Storage
Multiplatform key-value storage backed by SQLite for React Native Async Storage

## Installation

Expand All @@ -16,11 +16,52 @@ implementation("io.github.react-native-async-storage:async-storage-sqlite:VERSIO
pod 'AsyncStorageSQLiteKMP', 'VERSION'
```

## Usage
## Quick start

todo
Visit [Usage page](https://react-native-async-storage.github.io/sqlite-storage-native/usage/) to learn more

## Running tests

### Android

```kotlin
import org.asyncstorage.sqlitestorage.SQLiteStorageFactory

val storage = SQLiteStorageFactory(this).create("my_database_name")

suspend fun single(): Entry {
val entry = storage.read("my_key")
return entry
}

suspend fun singleWrite() {
val entry = Entry("my_key", "my_value")
storage.write(entry)
}
```


### iOS

```swift
import AsyncStorageSQLite

let storage = AsyncStorageSQLite("my_database_name")

func single() async throws -> Entry {
let entry = try await storage.read(key: "my_key")
return entry
}

func singleWrite() async throws {
let entry = Entry(key: "my_key", value: "my_value")
try await storage.write(entry: entry)
}
```


## Contributing

### Tests

Gradle tasks to run tests:

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Async Storage SQLite

Multiplatform native wrapper of SQLite for React Native Async Storage
Multiplatform key-value storage backed by SQLite for React Native Async Storage

!!! warning
Page in progress
Expand Down
5 changes: 4 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ repo_url: https://github.com/react-native-async-storage/sqlite-storage-kmp
nav:
- Getting started: index.md
- Usage: usage.md
- Changelog: changelog.md

theme:
name: material
palette:
primary: deep purple
accent: orange
accent: amber
icon:
repo: fontawesome/brands/github
logo: octicons/database-16
Expand All @@ -31,6 +32,8 @@ markdown_extensions:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- toc:
permalink: true

extra:
social:
Expand Down
2 changes: 1 addition & 1 deletion package_info.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Async Storage SQLite",
"version": "0.0.1",
"description": "Multiplatform native wrapper of SQLite for React Native Async Storage",
"description": "Multiplatform key-value storage backed by SQLite for React Native Async Storage",
"author": "Krzysztof Borowy",
"homepage": "https://github.com/react-native-async-storage/sqlite-storage-native",
"repository": "https://github.com/react-native-async-storage/sqlite-storage-native.git",
Expand Down

0 comments on commit 2aa433c

Please sign in to comment.