#Can you use tauri_plugin_sql to retrieve data in rust?

8 messages · Page 1 of 1 (latest)

dry mesa
#

I have installed and is using tauri_plugin_sql via svelte for an Android and iOS app. Works great. Can you retrieve data via rust to check a pin code? If so how? Now I do it via svelte but I guess it's more secure to do it using rust, or?

true radish
#

The plugin has no Rust api at the moment but you can use rusqlite or sqlx to do it. The plugin uses sqlx so you could re-use the plugin's connection if you chose that one but you don't gain much compared to just opening another connection 🤷

dry mesa
#

Thanks. Is it overkill to check a pin code via rust or is it safe enough to do it via svelte, as I have now? It's not that sensitive data.

true radish
#

hmm idk i always prefer doing stuff in rust so i may be a bit biased. Still, is it user initiated? Like does the user enter a pin that you compare to the pin in the db or something? Like, if part of this is on the js side then it doesn't really matter much if where you do the sql query itself imo

dry mesa
#

"does the user enter a pin that you compare to the pin in the db or something" Yes.

leaden night
true radish
#

What happened to tauri-plugin-rusqlite1 ? Oh wait, that actually exists lol (without the 1)

#

ngl, still thinking about semi-deprecating our current plugin in favor of a sqlite-only thing or just promoting one of the community plugins.