MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / Format

Method Format

storage/dsn.go:57–71  ·  view source on GitHub ↗

Format formats DSN to a connection string.

()

Source from the content-addressed store, hash-verified

55
56// Format formats DSN to a connection string.
57func (dsn *DSN) Format() string {
58 l := len(dsn.params)
59
60 if l <= 0 {
61 return fmt.Sprintf("file:%s", dsn.filename)
62 }
63
64 params := make([]string, 0, l)
65
66 for k, v := range dsn.params {
67 params = append(params, strings.Join([]string{k, v}, "="))
68 }
69
70 return fmt.Sprintf("file:%s?%s", dsn.filename, strings.Join(params, "&"))
71}
72
73// SetFileName sets the sqlite database file name of DSN.
74func (dsn *DSN) SetFileName(fn string) { dsn.filename = fn }

Callers 12

openDBFunction · 0.95
TestDSNFunction · 0.95
NewDatabaseFunction · 0.95
advanceNextHeightMethod · 0.45
mainCycleMethod · 0.45
pushBlockMethod · 0.45
produceBlockMethod · 0.45
runCurrentTurnMethod · 0.45
CheckAndPushNewBlockMethod · 0.45
NewSqliteFunction · 0.45
usqlRegisterFunction · 0.45
ResolveUpdateFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestDSNFunction · 0.76