Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How Create SQLite database in a tauri TS app?

Docs of tauri are still trash. I can only find tutorials in the internet about setting up a node ts server for web projects with sqlite. Does anybody know how I can do that? Assuming a boilerplate app that gets generated in the beginning after setup quick start guide. Where am I supposed to create the db? In the tauri rust or ts part?

I wan’t to store passwords in the database because I’m building a password generator.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Where am I supposed to create the db? In the tauri rust or ts part?

From the tauri docs:

Tauri is a framework for building tiny, blazing fast binaries for all major desktop platforms. Developers can integrate any front-end framework that compiles to HTML, JS and CSS for building their user interface. The backend of the application is a rust-sourced binary with an API that the front-end can interact with.

The TS part is meant to handle your frontend-related stuff, invoking Tauri commands, which are basically Rust functions. To answer your question, you should handle database interactions in the Rust part of your Tauri app, exposing an API that can be used by the TS part of your app that handles rendering the data.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading