I'm using SQLite for desktop applications, but in Rust it requires C wrapper that not native dependency.
Thoughts, maybe some modern alternative available?
Finally what do I want from the database:
storage in single file (at user profile directory)
transactions
foreign or just primary keys relations
async API would be good also (I/O data on background of the main UI thread)
If there is nothing better than SQLite yet, which of crates would be useful?
Also thoughts how to implement migrations from app version to version.. maybe I need some ORM wrapper, not sure. Please advice, how do you work with profile data in Rust these days
Despite SQLite being written in C, it is very high quality code, and it will not be easy to replicate that kind of project for anyone, in any language. That includes the original author btw, since at this point literal decades of work have gone into SQLite.
In addition to it being high quality, it is also very much battle-tested: it is used e.g. in Android, as a storage backend for apps, in Firefox and Thunderbird, in many Apple products, in Windows 10, and many more places.
Just as a general headsup: You likely want to avoid any async SQLite interfaces. Those come with a large performance penalty, as they try to emulate an async interface on top of the sync sqlite C API. See here for numbers.
Other than that: It's usually not a good choice to use libsqlite3-sys directly as that are the low level bindings to the c library. You should prefer rusqlite instead, which provides a high level API build on top of libsqlite3-sys
Thanks, both solutions looks interesting, especially redb for simple key/value storage - bookmarked so. Currently selected rusqlite, even can't say it is really high-level wrapper, especially in selection context, maybe will switch to sqlx later or diesel as supports migrations from the box.