Skip to content
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 sqlite database as cache #5

Open
ma4nn opened this issue Jan 27, 2025 · 5 comments
Open

Use sqlite database as cache #5

ma4nn opened this issue Jan 27, 2025 · 5 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@ma4nn
Copy link
Owner

ma4nn commented Jan 27, 2025

At the moment the sqlite database that is internally created by ppxml2db is in-memory.

To avoid creating the database over and over again, this could be changed to a temporary file on disk, that is recreated only after X days, after ppxml2db schema changes or with a CLI option like --no-cache.

This could also be helpful for debugging.

The challenge is, that I originally wanted to avoid saving the sensitive portfolio data anywhere else (that's why I chose the in-memory db), because then the user is responsible for maintaining/erasing that file (in a probably unknown location to him). So I'm not really sure if this feature makes sense. Comments are welcome!

@ma4nn ma4nn added enhancement New feature or request question Further information is requested labels Jan 27, 2025
@flywire
Copy link
Contributor

flywire commented Feb 3, 2025

https://github.com/ma4nn/pp-terminal/releases/tag/v0.5.0

  • internal database is saved if --debug option is present

Nice. How similar is .cache.sql to the ppxml2db *.db file? I'm thinking I'd like them to be the same.

@flywire
Copy link
Contributor

flywire commented Feb 3, 2025

I have ppxml2db installed in the same folder as my data files and launch it with a batch file containing for %%f in (*.sql) do echo .read %%~nf.sql >>tmp.txt.

This now includes .cache.sql. I could rewrite the batch file but a better solution would be keeping the ppxml2db installation independent, as pp-terminal does.

How can I:

  1. run the pp-terminal version of ppxml2db from my data file folder?
  2. update ppxml2db (realising I wouldn't be running a pp-terminal release)?

@ma4nn
Copy link
Owner Author

ma4nn commented Feb 4, 2025

How similar is .cache.sql to the ppxml2db *.db file?

At the moment it is the same. I will rename it to the .db suffix as well in the next release.

  1. [How can I] run the pp-terminal version of ppxml2db from my data file folder?

What exactly are you trying to achieve?
If you call pp-terminal --file=kommer.xml --debug the .cache.sql file is (re)created.

  1. [How can I] update ppxml2db (realising I wouldn't be running a pp-terminal release)?

Not sure what this means. If you run ppxml2db in a separate installation, then you can update it independently.

@flywire
Copy link
Contributor

flywire commented Feb 4, 2025

What exactly are you trying to achieve?

Use both ppxml2db and pp-terminal. If .cache.db is available I may not need to run ppxml2db but, if round-trip is actually realised, I would want to run ppdb2xml.

Not sure what this means.

To reiterate, I'm not looking at a separate installation, it's about running ppxml2db (and ppdb2xml) from the pp-terminal install, and upgrading the ppxml2db package within the pp-terminal package.

@ma4nn
Copy link
Owner Author

ma4nn commented Feb 4, 2025

Ok understood. But ppxml2db and pp-terminal are different applications, that should be run on its own.
Yes, pp-terminal internally uses the former, but this could change in the future or direct modifications to the database may be applied, etc. I don't plan to expose the ppxml2db scripts as an entry point.

Also the update process (regarding your question 2) is not meant to be handled by the end user, because it is shipped with pp-terminal. When a new ppxml2db version is released, a Pull Request is created automatically for the submodule.

Why not simply keep an installation of ppxml2db in a separate folder?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants