config+sqldb: make native SQL query config options configurable
Here, we make the sql query option params (batch size and pagination size) configurable. The defaults for SQLite vs Postgres are still the same but will be changed in an upcoming commit.
This commit is contained in:
5 files changed
+34
-6
No files matched your search
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
graphdb "github.com/lightningnetwork/lnd/graph/db"
|
||||
"github.com/lightningnetwork/lnd/kvdb"
|
||||
"github.com/lightningnetwork/lnd/lncfg"
|
||||
"github.com/lightningnetwork/lnd/sqldb"
|
||||
"github.com/lightningnetwork/lnd/sqldb/sqlc"
|
||||
)
|
||||
@@ -30,10 +31,15 @@ func (d *DefaultDatabaseBuilder) getGraphStore(baseDB *sqldb.BaseDB,
|
||||
},
|
||||
)
|
||||
|
||||
queryConfig := d.cfg.DB.Sqlite.QueryConfig
|
||||
if d.cfg.DB.Backend == lncfg.PostgresBackend {
|
||||
queryConfig = d.cfg.DB.Postgres.QueryConfig
|
||||
}
|
||||
|
||||
return graphdb.NewSQLStore(
|
||||
&graphdb.SQLStoreConfig{
|
||||
ChainHash: *d.cfg.ActiveNetParams.GenesisHash,
|
||||
QueryCfg: sqldb.DefaultQueryConfig(),
|
||||
QueryCfg: &queryConfig,
|
||||
},
|
||||
graphExecutor, opts...,
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user