Rename WAL, fixes.

This commit is contained in:
Nuno Cruces
2024-10-24 00:22:20 +01:00
parent c69ee0fe8d
commit 0cd0f48365
5 changed files with 24 additions and 11 deletions

View File

@@ -13,6 +13,8 @@ func NamedArg(arg string) (key, val string) {
}
// Unquote unquotes a string.
//
// https://sqlite.org/lang_keywords.html
func Unquote(val string) string {
if len(val) < 2 {
return val
@@ -40,6 +42,9 @@ func Unquote(val string) string {
return strings.ReplaceAll(rst, old, new)
}
// ParseBool parses a boolean.
//
// https://sqlite.org/pragma.html#syntax
func ParseBool(s string) (b, ok bool) {
if len(s) == 0 {
return false, false

View File

@@ -1,2 +1,9 @@
// Package sql3util implements SQLite utilities.
package sql3util
// ValidPageSize returns true if s is a valid page size.
//
// https://sqlite.org/fileformat.html#pages
func ValidPageSize(s int) bool {
return 512 <= s && s <= 65536 && s&(s-1) == 0
}