Skip to content

Stability and usage for a Rust/C/C++ project #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
adamski opened this issue May 24, 2025 · 1 comment
Open

Stability and usage for a Rust/C/C++ project #77

adamski opened this issue May 24, 2025 · 1 comment

Comments

@adamski
Copy link

adamski commented May 24, 2025

I would like to know if this repo is suitable for usage directly from a Rust or C/C++ application?

@simolus3
Copy link
Contributor

To make the logic contained in the core extension easy to use for our higher-level SDKs, all methods are supposed to be called through SQL functions on a SQLite database. So the idea is that you'd build the PowerSync core extension (either as a loadable shared library or statically with your application) and then either use sqlite_load_extension (for shared libraries) or powersync_init_static (for static libraries).

After loading the extension, you can start a sync operation through e.g. the powersync_operations vtab registered on open databases. This is possible with Rust or C/C++ applications too (and you wouldn't even have to use APIs from this repository, every generic SQLite library for those languages would work). That said, there is lot of additional logic implemented in our SDKs, such as:

  1. Calling powersync_initialize() to setup the schema.
  2. Connecting to the PowerSync service and handling sync lines (we're working on changes to move more logic related to this away from SDKs and into the core extension).
  3. Watching the ps_crud table for pending uploads and forwarding them to a backend connector.

So, while it's possible to use PowerSync directly from a native application, we don't have a full SDK for that to help fill the gaps. I don't think we currently have plans for that either, but you're welcome to suggest that for our roadmap. If you're interested in using PowerSync without a full SDK, we can also provide some pointers on which functions to call / what to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants