Commit graph

8 commits

Author SHA1 Message Date
Eng Zer Jun
e56a7945be
refactor: replace math.Min and math.Max with built-in min/max
Reference: https://github.com/lightningnetwork/lnd/pull/9451#pullrequestreview-2580942691
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2025-02-06 09:46:40 +08:00
Andras Banki-Horvath
91c3e1496f
sqldb: separate migration execution from construction
This commit separates the execution of SQL and in-code migrations
from their construction. This change is necessary because,
currently, the SQL schema is migrated during the construction
phase in the lncfg package. However, migrations are typically
executed when individual stores are constructed within the
configuration builder.
2025-01-23 09:10:59 +01:00
Alex Akselrod
780c271b80
sqldb: improve serialization error handling 2024-12-12 10:40:37 -08:00
Andras Banki-Horvath
478ae1e9b0
sqldb: cleanup scope state reset by adding reset closure to ExecTx
For SQL transactions, we often accumulate results in variables declared
outside the closure's scope. To eliminate the need for manually clearing
these containers, we introduce a reset function to ExecTx, mirroring the
approach already adopted in kvdb.
2024-04-11 15:04:04 +02:00
Andras Banki-Horvath
c6073a14ca
sqldb: ensure that we're using serializable isolation 2024-04-11 15:04:04 +02:00
Andras Banki-Horvath
43f4b14c28
kvdb+sqldb: use the same tx retry helper 2024-04-11 15:04:02 +02:00
Afanti
fff785c909
fix: correct the typo 2023-12-29 21:27:13 +08:00
positiveblue
5a7d7c2e4f
sqldb: add the sqldb package
This commit provides the scaffolding for using the new sql stores.
The new interfaces, structs and methods are in sync with other projects
like Taproot Assets.

- Transactional Queries: the sqldb package defines the interfaces required
to execute transactional queries to our storage interface.

- Migration Files Embedded: the migration files are embedded into the binary.

- Database Migrations: I kept the use of 'golang-migrate' to ensure our
codebase remains in sync with the other projects, but can be changed.

- Build Flags for Conditional DB Target: flexibility to specify our database
target at compile-time based on the build flags in the same way we do
with our kv stores.

- Update modules: ran `go mod tidy`.
2023-07-27 03:31:12 -07:00