Fix: String ToLower for PRAGMA's

This commit is contained in:
Gert-Jan Timmer 2018-05-29 13:06:07 +02:00
parent 46fb6884f2
commit a159b5d1ab
1 changed files with 5 additions and 4 deletions

View File

@ -875,9 +875,10 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
// _loc // _loc
if val := params.Get("_loc"); val != "" { if val := params.Get("_loc"); val != "" {
if val == "auto" { switch strings.ToLower(val) {
case "auto":
loc = time.Local loc = time.Local
} else { default:
loc, err = time.LoadLocation(val) loc, err = time.LoadLocation(val)
if err != nil { if err != nil {
return nil, fmt.Errorf("Invalid _loc: %v: %v", val, err) return nil, fmt.Errorf("Invalid _loc: %v: %v", val, err)
@ -887,7 +888,7 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
// _mutex // _mutex
if val := params.Get("_mutex"); val != "" { if val := params.Get("_mutex"); val != "" {
switch val { switch strings.ToLower(val) {
case "no": case "no":
mutex = C.SQLITE_OPEN_NOMUTEX mutex = C.SQLITE_OPEN_NOMUTEX
case "full": case "full":
@ -899,7 +900,7 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
// _txlock // _txlock
if val := params.Get("_txlock"); val != "" { if val := params.Get("_txlock"); val != "" {
switch val { switch strings.ToLower(val) {
case "immediate": case "immediate":
txlock = "BEGIN IMMEDIATE" txlock = "BEGIN IMMEDIATE"
case "exclusive": case "exclusive":