瀏覽代碼

fix bug in sqlite db name parsing

xormplus 7 年之前
父節點
當前提交
daa49c437c
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      dialect_sqlite3.go

+ 4 - 0
dialect_sqlite3.go

@@ -457,5 +457,9 @@ type sqlite3Driver struct {
 }
 
 func (p *sqlite3Driver) Parse(driverName, dataSourceName string) (*core.Uri, error) {
+	if strings.Contains(dataSourceName, "?") {
+		dataSourceName = dataSourceName[:strings.Index(dataSourceName, "?")]
+	}
+
 	return &core.Uri{DbType: core.SQLITE, DbName: dataSourceName}, nil
 }