This commit is contained in:
Andrew Jackson (Ajax) 2023-07-11 21:50:03 -05:00
parent 48ebd1330c
commit 3212a23741
3 changed files with 3 additions and 6 deletions

View File

@ -28,9 +28,6 @@ func withSetup(t *testing.T, f func(*kit.TestMiner)) {
kit.LatestActorsAt(-1), kit.LatestActorsAt(-1),
kit.MockProofs(), kit.MockProofs(),
kit.ConstructorOpts( kit.ConstructorOpts(
node.Override(new(config.ClusterDB), func() config.ClusterDB {
return staticConfig()
}),
node.Override(new(*clusterdb.DB), clusterdb.NewFromConfig), //Why does this not work? node.Override(new(*clusterdb.DB), clusterdb.NewFromConfig), //Why does this not work?
), ),
) )

View File

@ -35,12 +35,12 @@ type DB struct {
log func(string) log func(string)
} }
var logger = logging.Logger("sturdydb") var logger = logging.Logger("clusterdb")
// NewFromConfig is a convenience function. // NewFromConfig is a convenience function.
// In usage: // In usage:
// //
// db, err := NewFromConfig(config.SturdyDB) // in binary init // db, err := NewFromConfig(config.ClusterDB) // in binary init
func NewFromConfig(cfg config.ClusterDB) (*DB, error) { func NewFromConfig(cfg config.ClusterDB) (*DB, error) {
return New( return New(
cfg.Hosts, cfg.Hosts,

View File

@ -19,7 +19,7 @@ type Intf interface {
// rawStringOnly is _intentionally_private_ to force only basic strings in SQL queries. // rawStringOnly is _intentionally_private_ to force only basic strings in SQL queries.
// In any package, raw strings will satisfy compilation. Ex: // In any package, raw strings will satisfy compilation. Ex:
// //
// sturdydb.Exec("INSERT INTO version (number) VALUES (1)") // clusterDB.Exec("INSERT INTO version (number) VALUES (1)")
// //
// This prevents SQL injection attacks where the input contains query fragments. // This prevents SQL injection attacks where the input contains query fragments.
type rawStringOnly string type rawStringOnly string