fix: recognize json_valid constraint as json field type for database mariadb #2746 (#3309)

This commit is contained in:
oldme
2024-03-06 19:07:31 +08:00
committed by GitHub
parent 97fcd9d726
commit 290f4a3e65
16 changed files with 172 additions and 63 deletions

View File

@ -16,8 +16,6 @@ import (
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
)
// Driver is the driver for postgresql database.
@ -37,21 +35,6 @@ func init() {
}
}
// formatSqlTmp formats sql template string into one line.
func formatSqlTmp(sqlTmp string) string {
var err error
// format sql template string.
sqlTmp, err = gregex.ReplaceString(`[\n\r\s]+`, " ", gstr.Trim(sqlTmp))
if err != nil {
panic(err)
}
sqlTmp, err = gregex.ReplaceString(`\s{2,}`, " ", gstr.Trim(sqlTmp))
if err != nil {
panic(err)
}
return sqlTmp
}
// New create and returns a driver that implements gdb.Driver, which supports operations for PostgreSql.
func New() gdb.Driver {
return &Driver{}