Files
EdgeNode/internal/utils/dbs/db_test.go

18 lines
439 B
Go
Raw Normal View History

2023-07-27 10:03:18 +08:00
// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
package dbs_test
import (
"net/url"
"testing"
)
func TestParseDSN(t *testing.T) {
var dsn = "file:/home/cache/p43/.indexes/db-3.db?cache=private&mode=ro&_journal_mode=WAL&_sync=NORMAL&_cache_size=88000"
2023-07-27 10:03:18 +08:00
u, err := url.Parse(dsn)
if err != nil {
t.Fatal(err)
}
t.Log(u.Path) // expect: :/home/cache/p43/.indexes/db-3.db
}