add a version check for sqlite. need 3.20.0 at least.
Ted Unangst tedu@tedunangst.com
Wed, 13 Mar 2024 16:13:24 -0400
1 files changed,
10 insertions(+),
1 deletions(-)
jump to
M
util.go
→
util.go
@@ -45,7 +45,7 @@ "regexp"
"strings" "golang.org/x/crypto/bcrypt" - _ "humungus.tedunangst.com/r/go-sqlite3" + "humungus.tedunangst.com/r/go-sqlite3" "humungus.tedunangst.com/r/webs/httpsig" "humungus.tedunangst.com/r/webs/login" )@@ -56,6 +56,15 @@ var dbtimeformat = "2006-01-02 15:04:05"
var alreadyopendb *sql.DB var stmtConfig *sql.Stmt + +func init() { + vers, num, _ := sqlite3.Version() + if num < 3020000 { + fmt.Fprintf(os.Stderr, "libsqlite is too old. required: %s found: %s\n", + "3.20.0", vers) + os.Exit(1) + } +} func initdb() { blobdbname := dataDir + "/blob.db"