Merge pull request #7252 from ellemouton/sqlite-pt2

multi: add sqlite backend option
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2023-01-31 10:14:46 -08:00
commit 5d22d5eb6c
40 files changed
+523 -237

No files matched your search

+5
View File
@@ -278,6 +278,11 @@ func (cfg *BaseNodeConfig) GenArgs() []string {
case BackendPostgres:
args = append(args, "--db.backend=postgres")
args = append(args, "--db.postgres.dsn="+cfg.PostgresDsn)
case BackendSqlite:
args = append(args, "--db.backend=sqlite")
args = append(args, fmt.Sprintf("--db.sqlite.busytimeout=%v",
SqliteBusyTimeout))
}
if cfg.FeeURL != "" {
+3
View File
@@ -131,6 +131,9 @@ func TestLightningNetworkDaemon(t *testing.T) {
case "postgres":
dbBackend = lntest.BackendPostgres
case "sqlite":
dbBackend = lntest.BackendSqlite
default:
require.Fail(t, "unknown db backend")
}
+1 -1
View File
@@ -49,7 +49,7 @@ var (
// dbBackendFlag specifies the backend to use.
dbBackendFlag = flag.String("dbbackend", "bbolt", "Database backend "+
"(bbolt, etcd, postgres)")
"(bbolt, etcd, postgres, sqlite)")
)
// TestLightningNetworkDaemonTemp performs a series of integration tests
+1
View File
@@ -33,6 +33,7 @@ const (
BackendBbolt DatabaseBackend = iota
BackendEtcd
BackendPostgres
BackendSqlite
)
var (
+4
View File
@@ -29,4 +29,8 @@ const (
// NodeStartTimeout is the timeout value when waiting for a node to
// become fully started.
NodeStartTimeout = time.Second * 120
// SqliteBusyTimeout is the maximum time that a call to the sqlite db
// will wait for the connection to become available.
SqliteBusyTimeout = time.Second * 10
)
+4
View File
@@ -30,4 +30,8 @@ const (
// NodeStartTimeout is the timeout value when waiting for a node to
// become fully started.
NodeStartTimeout = time.Second * 120
// SqliteBusyTimeout is the maximum time that a call to the sqlite db
// will wait for the connection to become available.
SqliteBusyTimeout = time.Second * 10
)
+4
View File
@@ -29,4 +29,8 @@ const (
// NodeStartTimeout is the timeout value when waiting for a node to
// become fully started.
NodeStartTimeout = time.Second * 120
// SqliteBusyTimeout is the maximum time that a call to the sqlite db
// will wait for the connection to become available.
SqliteBusyTimeout = time.Second * 10
)