Skip to content

use sql store in payments#10645

Merged
ziggie1984 merged 3 commits intolightningnetwork:masterfrom
ziggie1984:set-sql-store-payments
Mar 17, 2026
Merged

use sql store in payments#10645
ziggie1984 merged 3 commits intolightningnetwork:masterfrom
ziggie1984:set-sql-store-payments

Conversation

@ziggie1984
Copy link
Collaborator

@ziggie1984 ziggie1984 commented Mar 17, 2026

bugfix using the sql backend actually in prod

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the payments database initialization logic to directly instantiate the SQL-backed payments store. By removing an intermediate helper function and its associated imports, the configuration process becomes more explicit and less abstracted, specifically for the production environment. This change simplifies the codebase by directly integrating the SQL store where it's intended to be used.

Highlights

  • Payments Database Initialization: The config_builder.go file was updated to directly initialize the paymentsdb.SQLStore using sqldb.NewTransactionExecutor, replacing the previous getPaymentsStore helper function.
  • Removed Abstraction: The config_prod.go file had the getPaymentsStore function and its related imports removed, streamlining the database configuration by eliminating an abstraction layer no longer needed.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • config_builder.go
    • Modified the BuildDatabase method to directly construct a paymentsdb.SQLStore instance.
    • Introduced sqldb.NewTransactionExecutor for managing database transactions for the payments store.
  • config_prod.go
    • Removed unused imports for paymentsdb and sqldb.
    • Deleted the getPaymentsStore helper function, as its functionality is now handled directly in config_builder.go.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ziggie1984 ziggie1984 added no-changelog payments Related to invoices/payments labels Mar 17, 2026
@ziggie1984 ziggie1984 self-assigned this Mar 17, 2026
@ziggie1984 ziggie1984 marked this pull request as ready for review March 17, 2026 19:15
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the payment store initialization to use the SQL backend when the db.use-native-sql flag is enabled, removing the previous build-tag-based logic. This change makes the payment store initialization consistent with other database backends in the project. The logic has been centralized in config_builder.go, and the now-unused getPaymentsStore function has been removed from config_prod.go. The changes appear correct and align with the goal of consistently using the SQL backend when configured.

@ziggie1984 ziggie1984 force-pushed the set-sql-store-payments branch from d2c0c5c to 304a0aa Compare March 17, 2026 19:20
@ziggie1984 ziggie1984 requested a review from saubyk March 17, 2026 19:46
@ziggie1984 ziggie1984 force-pushed the set-sql-store-payments branch from 8026996 to f56e933 Compare March 17, 2026 19:56
Copy link
Collaborator

@ViktorT-11 ViktorT-11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uTACK LGTM 🔥

@ziggie1984 ziggie1984 force-pushed the set-sql-store-payments branch from f068e20 to 4f73b4a Compare March 17, 2026 20:42
@ziggie1984 ziggie1984 enabled auto-merge March 17, 2026 20:47
Copy link
Collaborator

@saubyk saubyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

Copy link
Collaborator

@starius starius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀
Thanks for the quick fix!

@ziggie1984 ziggie1984 merged commit fec556d into lightningnetwork:master Mar 17, 2026
35 of 38 checks passed
@ziggie1984 ziggie1984 deleted the set-sql-store-payments branch March 17, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog payments Related to invoices/payments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants