What changed, and why it matters
This commit creates a brand-new, empty code module called sqldb/v2. It only adds a Go module definition, dependency checksums, and a simple logging helper. There is no actual database logic, no user input handling, and no security-sensitive change.
No security action needed; treat as routine scaffolding.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit introduces the skeleton for sqldb/v2: go.mod/go.sum pinning btclog dependencies and a log.go file that defines a disabled-by-default logger and UseLogger/DisableLog helpers. No SQL implementation, migrations, queries, or network-facing code are present.
Changed components
sqldb/v2/go.modsqldb/v2/go.sumsqldb/v2/log.goInspect captured patch +35 / −0
diff --git a/sqldb/v2/go.mod b/sqldb/v2/go.mod
new file mode 100644
index 0000000..1fadb13
--- /dev/null
+++ b/sqldb/v2/go.mod
@@ -0,0 +1,7 @@
+module github.com/lightningnetwork/lnd/sqldb/v2
+
+require github.com/btcsuite/btclog/v2 v2.0.1-0.20250602222548-9967d19bb084
+
+require github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c // indirect
+
+go 1.23.12
\ No newline at end of file
diff --git a/sqldb/v2/go.sum b/sqldb/v2/go.sum
new file mode 100644
index 0000000..fc3f44c
--- /dev/null
+++ b/sqldb/v2/go.sum
@@ -0,0 +1,4 @@
+github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c h1:4HxD1lBUGUddhzgaNgrCPsFWd7cGYNpeFUgd9ZIgyM0=
+github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c/go.mod h1:w7xnGOhwT3lmrS4H3b/D1XAXxvh+tbhUm8xeHN2y3TQ=
+github.com/btcsuite/btclog/v2 v2.0.1-0.20250602222548-9967d19bb084 h1:y3bvkt8ki0KX35eUEU8XShRHusz1S+55QwXUTmxn888=
+github.com/btcsuite/btclog/v2 v2.0.1-0.20250602222548-9967d19bb084/go.mod h1:XItGUfVOxotJL8kkuk2Hj3EVow5KCugXl3wWfQ6K0AE=
diff --git a/sqldb/v2/log.go b/sqldb/v2/log.go
new file mode 100644
index 0000000..19f43f7
--- /dev/null
+++ b/sqldb/v2/log.go
@@ -0,0 +1,24 @@
+package sqldb
+
+import "github.com/btcsuite/btclog/v2"
+
+// Subsystem defines the logging code for this subsystem.
+const Subsystem = "SQL2"
+
+// log is a logger that is initialized with no output filters. This
+// means the package will not perform any logging by default until the caller
+// requests it.
+var log = btclog.Disabled
+
+// DisableLog disables all library log output. Logging output is disabled
+// by default until UseLogger is called.
+func DisableLog() {
+ UseLogger(btclog.Disabled)
+}
+
+// UseLogger uses a specified Logger to output package logging info.
+// This should be used in preference to SetLogWriter if the caller is also
+// using btclog.
+func UseLogger(logger btclog.Logger) {
+ log = logger
+}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.