-
Notifications
You must be signed in to change notification settings - Fork 264
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
[sql] Call from Rust side #506
Comments
Nope. I couldn't come up with a nice enough api (without spending too much time on it), so it's on hold for now, meaning you'd have to use some rust crate to connect to the db. It's still planned though so i'll leave this issue open.
Honestly, you should do that either way if your frontend don't need access to it directly or if it's only a few requests you can better provide via tauri commands. Way more secure to not expose the db in your frontend and if that matters, rust may be able to optimize the code a bit more if it's more specific 🤷 |
Could we consider exposing the database instance as a compromise between exposing a nice and polished api and having to reinvent the wheel? Right now I'm literally copying code from the plugin to connect another pool to my sqlite file using |
To continue the conversation that briefly took place in #509. @thulasi-ram thanks for your instructive write-up, didn't know about Greenspun and Hyrums.
To summarize, I'm in favor of making DbInstance public and let query builders and ORM to the 3rd parties. |
In that case, every 0.x release counts as a major (breaking) release so we may have to start with this fairly early on, but so far sqlx had a pretty slow release cycle so that may not be too bad. |
What is currently the best solution to this problem? I have recently started working with Rust and Tauri, and I would like some examples. Thanks |
Any news on that? It's a little weird to only provide a JS API for SQL. I think only exposing |
I wanted to know if it's possible to make queries from the Rust side, or if should be using other library if I don't plan to use the frontend side.
Currently, with the store plugin I do this:
I checked the code and it doesn't seem to be any method to call from the Rust side.
The text was updated successfully, but these errors were encountered: