Closed ogcatt closed 1 year ago
Hey, any of the built-in storage options other than InMemory
should be persistent. Are you using InMemory
?
If you are using InMemory
, could you try with the Sqlite
store and let me know if that fixes your issue?
For example, let store = Sqlite::new("./AcceptXMR_DB", "invoices").unwrap();
. It will use the db file at that path, or it will create one if it doesn't exist. Then use it in the payment gateway builder. You will need to add the Sqlite
feature in Cargo.toml
for it to compile.
I will try to use the Sqlite store and I will let you know how it goes. I am using InMemory btw.
I am getting a dependency conflict because I am using seaorm which requires libsqlite3-sys v0.24.2, but acceptxmr requires sqlite3-sys v0.14.0... I am not sure how to fix this 😔
Got it, yeah that was your problem then. InMemory
means stored in RAM, so it's not persistent.
~Hmm, yep looks the sqlite crate used by AcceptXMR hasn't kept their sqlite3-sys dependency up-to-date... that's not very cool, I'll see about fixing that.~ Edit: Looks like it's up-to-date, it's just using a separate sys crate. I will consider changing acceptxmr to use sqlx or similar libsqlite3-sys based crate since that seems more popular now, but it probably won't happen in very the near term.
Your options in the meantime:
Sled
store instead of the Sqlite
one (you'll need to enable the sled
feature). This is probably your easiest option.sqlx
from seaorm, maybe using sqlx here would be elegant. This is more work than the first option but gives you the most flexibility.Thank you very much for this suggestion, I am using sled for acceptxmr now and it is persistent! Btw nice work with this crate, I may be one of the first to dev an ecommerce store with it :) much love 😊
Do I need to create a custom storage (in the build function) to make invoices persistant? Or is it a misconfiguration? Thanks.