package sql3utilimport// NamedArg splits an named arg into a key and value,// around an equals sign.// Spaces are trimmed around both key and value.func ( string) (, string) { , , _ = strings.Cut(, "=") = strings.TrimSpace() = strings.TrimSpace()return}// Unquote unquotes a string.//// https://sqlite.org/lang_keywords.htmlfunc ( string) string {iflen() < 2 {return } := [0] := [len()-1] := [1 : len()-1]if == '[' && == ']' {return }if != {return }var , stringswitch {default:returncase'`': , = "``", "`"case'"': , = `""`, `"`case'\'': , = `''`, `'` }returnstrings.ReplaceAll(, , )}// ParseBool parses a boolean.//// https://sqlite.org/pragma.html#syntaxfunc ( string) (, bool) {iflen() == 0 {returnfalse, false }if [0] == '0' {returnfalse, true }if'1' <= [0] && [0] <= '9' {returntrue, true }switchstrings.ToLower() {case"true", "yes", "on":returntrue, truecase"false", "no", "off":returnfalse, true }returnfalse, false}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.