Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/powersync-ja/powersync-sqlite-core
PowerSync SQLite Extension
https://github.com/powersync-ja/powersync-sqlite-core
Last synced: 3 months ago
JSON representation
PowerSync SQLite Extension
- Host: GitHub
- URL: https://github.com/powersync-ja/powersync-sqlite-core
- Owner: powersync-ja
- License: apache-2.0
- Created: 2023-08-29T14:13:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-18T10:44:08.000Z (4 months ago)
- Last Synced: 2024-09-18T14:27:01.103Z (4 months ago)
- Language: C
- Size: 2.71 MB
- Stars: 14
- Watchers: 9
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-sqlite - powersync-ja/powersync-sqlite-core: PowerSync SQLite Extension
README
# PowerSync SQLite Extension
This extension is used by PowerSync client SDKs.
The APIs here not currently stable, and may change in any release. The APIs are intended to be used by PowerSync SDKs only.
# API
Primary APIs:
```sql
-- Load the extension
-- Sets up functions and views, but does not touch the database itself.
.load powersync-- Configure the schemas.
-- Creates data tables, indexes and views.
SELECT powersync_replace_schema('{"tables": [{"name": "test", "columns": [{"name": "name", "type": "text"}]}]}');```
Other APIs:
```sql
-- Initialize the extension data (creates internal tables).
-- Optional - also called as part of powersync_replace_schema().
-- Only useful to ensure internal tables are configured without touching the schema.
SELECT powersync_init();```
# Building and running
Initialize submodules recursively
```
git submodule update --init --recursive
``````sh
# Build the shell
cargo build -p powersync_sqlite
./target/debug/powersync_sqlite test.db "select powersync_rs_version()"# Build the loadable extension
cargo build -p powersync_loadable
sqlite3 ":memory:" ".load ./target/debug/libpowersync" "select powersync_rs_version()" #This requires sqlite3 installed# Build the release loadable extension
cargo build -p powersync_loadable --release# Build for iOS
./all-ios-loadable.sh
```# Acknowledgements
Structure of the SQLite extension using Rust is inspired by [cr-sqlite](https://github.com/vlcn-io/cr-sqlite/).