mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-11 21:49:13 +00:00
Rename WAL, fixes.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user