add Offset function for gdb.Model; improve schema changing feature for gdb
package main
import (
- "encoding/base64"
"fmt"
- "github.com/gogf/gf/g/encoding/gbase64"
+
+ "github.com/gogf/gf/g/text/gregex"
)
func main() {
- data := "HwHsGhXMaGc==="
- datab, err := gbase64.Decode([]byte(data))
- fmt.Println(err)
- fmt.Println(datab)
- fmt.Println(string(datab))
-
- s, e := base64.StdEncoding.DecodeString(data)
- fmt.Println(e)
- fmt.Println(string(s))
+ query := "SELECT * FROM user where status=1 LIMIT 10, 100"
+ query, _ = gregex.ReplaceString(` LIMIT (\d+),\s*(\d+)`, ` LIMIT $1 OFFSET $2`, query)
+ fmt.Println(query)
}
