|
| 1 | +<p align="center"> |
| 2 | + <a href="https://www.powersync.com" target="_blank"><img src="https://github.com/powersync-ja/.github/assets/7372448/d2538c43-c1a0-4c47-9a76-41462dba484f"/></a> |
| 3 | +</p> |
| 4 | + |
| 5 | +_[PowerSync](https://www.powersync.com) is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres, MongoDB or MySQL on the server-side._ |
| 6 | + |
1 | 7 | # powersync_core |
2 | 8 |
|
3 | | -This is the core SQLite extension, containing all the logic. |
| 9 | +This is the core SQLite extension, containing all the logic. This is used internally by PowerSync SDKs, |
| 10 | +and would typically not be used by users directly. |
| 11 | + |
| 12 | +The role of the extension is to create user-defined functions that higher-level SDKs would use to implement |
| 13 | +schema management and a PowerSync client. |
| 14 | +Not all of this is documented, but [this directory](https://github.com/powersync-ja/powersync-sqlite-core/tree/main/docs) |
| 15 | +provides some hints on how a custom PowerSync SDK could be implemented. |
4 | 16 |
|
5 | | -Since the different build configurations (loadable extension, bundled SQLite shell) |
6 | | -use different cargo config, we can't completely separate them just using features. |
7 | | -Instead, we use different crates depending on this core lib. |
| 17 | +For this reason, the crate doesn't have much of a public API. In the default build mode, it doesn't expect |
| 18 | +SQLite to be linked and exposes a single function: `sqlite3_powersync_init`, |
| 19 | +a [loadable extension](https://sqlite.org/loadext.html) entrypoint. |
8 | 20 |
|
| 21 | +For applications linking SQLite, the `static` feature of this crate can be enabled. |
| 22 | +With that feature, `powersync_init_static()` can be called to load the |
| 23 | +extension for all new connections. |
| 24 | +The application is responsible for linking SQLite in that case. |
0 commit comments