Merge pull request #7252 from ellemouton/sqlite-pt2
multi: add sqlite backend option
This commit is contained in:
40 files changed
+523
-237
No files matched your search
@@ -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 != "" {
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -33,6 +33,7 @@ const (
|
||||
BackendBbolt DatabaseBackend = iota
|
||||
BackendEtcd
|
||||
BackendPostgres
|
||||
BackendSqlite
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -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
|
||||
)
|
||||
@@ -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
|
||||
)
|
||||
@@ -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
|
||||
)
|
||||
Reference in new issue
Block a user