diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 9535a65..df06881 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -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 diff --git a/.gitignore b/.gitignore index 58d2556..c87a2d7 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,4 @@ android/keystores/debug.keystore # Built website site/ +docs/changelog.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..075df13 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## [0.1.0] - 2024-XX-XX + +Initial release. diff --git a/README.md b/README.md index 1bd0e5f..1031c0d 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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: diff --git a/docs/index.md b/docs/index.md index 95a5eb1..2ed57b1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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 diff --git a/mkdocs.yml b/mkdocs.yml index 487c4ff..f6997de 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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 @@ -31,6 +32,8 @@ markdown_extensions: anchor_linenums: true line_spans: __span pygments_lang_class: true + - toc: + permalink: true extra: social: diff --git a/package_info.json b/package_info.json index 93c1893..cb7c43e 100644 --- a/package_info.json +++ b/package_info.json @@ -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",