cleanup sqlite store creation

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
This commit is contained in:
Dmitri Dolguikh
2026-08-11 16:05:59 +02:00
parent 9427fa87e1
commit 05511cc13d
@@ -5,6 +5,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"net/url" "net/url"
"os"
"path/filepath" "path/filepath"
"reflect" "reflect"
"runtime" "runtime"
@@ -31,13 +32,13 @@ type SqliteStoreConn struct {
} }
func NewSqliteStore(ctx context.Context, storeFile, dataDir string) (*SqliteStore, error) { func NewSqliteStore(ctx context.Context, storeFile, dataDir string) (*SqliteStore, error) {
// storeFile := storeSqliteFileName dbfile := storeFile
// if envFile, ok := os.LookupEnv("NB_STORE_ENGINE_SQLITE_FILE"); ok && envFile != "" { if envFile, ok := os.LookupEnv("NB_STORE_ENGINE_SQLITE_FILE"); ok && envFile != "" {
// storeFile = envFile dbfile = envFile
// } }
// Separate file path from any SQLite URI query parameters (e.g., "store.db?mode=rwc") // Separate file path from any SQLite URI query parameters (e.g., "store.db?mode=rwc")
filePath, query, hasQuery := strings.Cut(storeFile, "?") filePath, query, hasQuery := strings.Cut(dbfile, "?")
connStr := filePath connStr := filePath
if filePath != ":memory:" && !filepath.IsAbs(filePath) { if filePath != ":memory:" && !filepath.IsAbs(filePath) {