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
use tauri store plugin to persist app data #29
Comments
I would be interested in contributing and working on this issue. To clarify, the store plugin is not currently yet in use, and we would want to implement it for storing user data (settings, transfer history etc)? |
Hi Alex, Like you said, the feature has not been implemented at all. It is intended to store the user settings (color theme, transfer history and anything required in the future). I'm considering an embedded database, for the transfer history and storing the application settings such as theme, using the Tauri store plugin. I'm open to discussing better approach to solving this and further clarification. |
Sure! So should we discuss it here or via email or how to move forward? I have a few thoughts already but will start learning to work with the send-file codebase more and how to use the store plugin. The plugin looks pretty straightforward |
We can discuss it all here, |
Ok! I am ready to go, please feel free to assign the issue to me. I've forked and cloned the repo locally |
Great! |
I just push a major change, please sync the fork to avoid conflict in future PR |
Got it. Thanks for letting me know. |
You are welcome 🤗 |
`Warn Waiting for your frontend dev server to start on http://localhost:1420/... 3 import App from './App.tsx' tsconfig.json:11:5 - error TS5023: Unknown compiler option 'allowImportingTsExtensions'. 11 "allowImportingTsExtensions": true, Found 2 errors in 2 files. Errors Files I am getting this error message when I clone and run yarn tauri dev. Should I be using any flags or have I somehow messed up the setup? |
I notice the error in the CI too, and I'm currently looking into fixing it. That said, the error does not occur at my end, I believe it could be a environment-related problem (eg Nde.js version |
See the solution pointed out here |
Thanks. I had tried reinstalling typescript. My version:
I also ran: However the error persists. I''m going to research more on my end. |
Alright, Let me know when you see a fix. I'd look into it again |
Hi, @RPG-Alex any fix on the issue? |
So I have only one thing I suspect, as everything else has been fruitless. What version of yarn are you using?
I am on arch linux, and am running: Are you running the same version? I also had installed yarn from pacman, rather than through npm. I installed via npm but its the same version. I cannot figure out why it would be like this otherwise. I have a suspicion it is my yarn version but I'm not sure that makes sense. Nothing else has worked. Have tweaked the config jsons etc with no results |
I have yarn v 1.22.19. Try deleting the browser directory, see if it works |
See this article on resolving error |
Also, what version on Node.js do you use |
I think I fixed it, |
It's done! Everything should work fine now. Let me know if anything comes up |
Have synced, pulled, and executed. Can confirm this will now compile and run! PS: I will start working on this issue (#29) for persistent data tomorrow. |
I added "preinstall" to the scripts in package.json to install the dependencies of the browser directory |
Hi @RPG-Alex I made some designs review, In addition to using the store plugin to save some key-value pair of data, such as the color theme, can we work on an embedded SQLite database - something which can be bundled with the application binary, this will allow extending the application storage capacity for future use. The Database created can be accessed on the UI using Tauri command... Consider this function signature of suchlike #[tauri::command]
pub fn save_record<T>(arg: T, table: &str) { ... } A similar API can be implemented to fetch saved data. Please, let me know if you have any questions |
Hey @opeolluwa thanks for letting me know, I started looking at the code base now. For the database/data storage I think it will be better to map out everything that is needed for storage and define the data structures, then it should be easy to store in an SQL format and/or as JSON to a file etc, and access and modify. For now I do not have a clear idea of the exact values and where they are being set in the code base. |
The user file transfer history is what we'll persist in the database, the fields will be
*string can be used, in place of enum. I think SQLite does not support enum ** The date would be parsed on the front end. Other settings such as app data settings, language, color theme, e.t.c will be stored using the Tauri key-value store plugin. |
Hi, Alex, how is it going |
@opeolluwa hello! I saw you updated the repository name. I'll make sure to use that rather than sendfile going forward. |
hello! I saw you updated the repository name. I'll make sure to use that rather than sendfile going forward.
Regarding the persistant app data, I have been looking through the existing functionality and user settings, and it appears that there isn't really an ability for a user to set anything quite yet.
The settings tab doesn't do anything at the moment. So for this it may be better to hold off on this issue until there is user data to store, and then build off that. Let me know what you think You can carry on, nonetheless. I'd appreciate that. |
@opeolluwa I've pushed a transfer record file. Let me know your thoughts. Mostly on structure. Do you have experience working with Tauri's sqlite plugin? I do not and was scratching my head a bit as this will fail if I import this library and try to compile the application. |
Can I use the store to store data other than just the settings, essentially treating it like localstorage. or should i use the localstrage for that assuming its persistent. For small apps with not much data it would be overkill to use sql db's specially for data that are objects it would be convinient to use the persistent store plugin. I mean i'm already using it but i dont know the limits of it. Also, the mirror repo doesn't mention anything about removing entries.. Apologies if my question is unnecessary and naive. |
@RPG-Alex I reviewed the SQLite plugin. The computation is largely client side, all the backend require us to initialize the database, which I already did |
Hi @JohnYepthomi your questions are absolutely not naive. The thing is, software should be built with scalability in mind. That's why we're opting for the Tauri store plugin to persist the user application settings and the SQLite plugin to persist the application data. |
What do you mean client side? Are you talking about the React frontend? |
Hi Alex, I looked up the SQLite plugin. The heavy computation will the done in the React codebase. Also, there isn't any more computation required on the backend than the Plugin initialization, which has been done. |
I think the work here is completed, since we already opted for the plugins rather than an embedded database. I'd look up the SQLite plugin client side integration and fix it or push it out as a feature request. Thank you so much for your time and effort. 💯 |
If you'd be interested, I have another Open Source software being built in Rust which enable front end developers build functional full stack applications without having to write any backend code. I'm currently refining the project scope for contribution. It will be great to have you |
@opeolluwa Thanks for letting me know! I was on vacation, back now. If this issue is closed can you mark it closed? I will definitely checkout your other project. |
Use the store plugin to persist app data. This will primarily contain the file transfer history and the user settings.
The text was updated successfully, but these errors were encountered: