Skip to content

Migrate payjoin-cli Sled db to sqlite3 #867

Closed

Description

@arminsabouri

Image

Most of our current integrations use some form of sql-like database (Liana, bullbitcoin, bitcoin-core wallet, cake(?)). Payjoin-cli should migrate from sled to sqlite3 so our reference can continue to serve as an example for downstream wallet developers. Not a high priority. Wanted to make a note of this before I forget.

Activity

  1. added
    enhancement
    good first issue
    on Jul 10, 2025
  2. changed the title [-]Migrate payjoin-cli db to sqlite3[/-] [+]Migrate payjoin-cli Sled db to sqlite3[/+] on Jul 10, 2025
  3. DanGould commented on Jul 10, 2025

    @DanGould
    Member

    The crate by the name of sqlite3 is 7 years old and unmaintained, so I'm assuming you just mean the actual database. Seems like we could use a slightly older version of rusqlite 0.29 to make this happen

  4. arminsabouri commented on Jul 10, 2025

    @arminsabouri
    ContributorAuthor

    Yes Thanks for pointing that out. sqlite3 the binary not the library. The library I have used is rustqlite with r2d2 for the connection pool

  5. nothingmuch commented on Jul 10, 2025

    @nothingmuch
    Contributor

    FWIW ldk-node uses 0.31.0, IIUC that specific version of rusqlite is also in use in other projects and supports the MSRV of 1.63

  6. Mshehu5 commented on Jul 11, 2025

    @Mshehu5
    Contributor

    I'd like to handle this issue

  7. arminsabouri commented on Jul 11, 2025

    @arminsabouri
    ContributorAuthor

    @Mshehu5 thanks for volunteering!
    I want to be clear about what the expected outcome. For both the receiver and sender there should be two tables:

    • Sessions: includes a primary key. IIRC in payjoin-cli today we call it session id and a completed_at timestamp which serves as a indicator for whether or not the session is closed.
    • Session events. When the session persister's save_event is invoke it should add a row to this table. Session events should include some form of created_at timestamp so they are sortable when we load them in the session persister. Lastly this table should have a fk relationship with the sessions table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgood first issuepayjoin-cli

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions