This commit is contained in:
John Guo
2025-04-10 14:12:35 +08:00
parent 1534abdb05
commit 2cc4835c49
1311 changed files with 4587 additions and 4587 deletions

View File

@ -1,9 +1,9 @@
module github.com/gogf/gf/contrib/drivers/pgsql/v2
module github.com/gogf/gf/contrib/drivers/pgsql/v3
go 1.22
require (
github.com/gogf/gf/v2 v2.9.0
github.com/gogf/gf/v3 v3.0.0-alpha
github.com/lib/pq v1.10.9
)
@ -35,4 +35,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)
replace github.com/gogf/gf/v2 => ../../../
replace github.com/gogf/gf/v3 => ../../../

View File

@ -14,8 +14,8 @@ package pgsql
import (
_ "github.com/lib/pq"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/os/gctx"
)
// Driver is the driver for postgresql database.

View File

@ -13,11 +13,11 @@ import (
"github.com/lib/pq"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/frame/g"
"github.com/gogf/gf/v3/text/gregex"
"github.com/gogf/gf/v3/text/gstr"
"github.com/gogf/gf/v3/util/gconv"
)
// ConvertValueForField converts value to database acceptable value.

View File

@ -12,9 +12,9 @@ import (
"fmt"
"strings"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/errors/gcode"
"github.com/gogf/gf/v3/errors/gerror"
)
// DoExec commits the sql string and its arguments to underlying driver

View File

@ -10,9 +10,9 @@ import (
"context"
"fmt"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/text/gregex"
"github.com/gogf/gf/v3/text/gstr"
)
// DoFilter deals with the sql string before commits it to underlying sql driver.

View File

@ -10,9 +10,9 @@ import (
"context"
"database/sql"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/errors/gcode"
"github.com/gogf/gf/v3/errors/gerror"
)
// DoInsert inserts or updates data for given table.

View File

@ -9,11 +9,11 @@ package pgsql
import (
"fmt"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/errors/gcode"
"github.com/gogf/gf/v3/errors/gerror"
"github.com/gogf/gf/v3/text/gstr"
"github.com/gogf/gf/v3/util/gconv"
)
// FormatUpsert returns SQL clause of type upsert for PgSQL.

View File

@ -10,10 +10,10 @@ import (
"database/sql"
"fmt"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/errors/gcode"
"github.com/gogf/gf/v3/errors/gerror"
"github.com/gogf/gf/v3/text/gstr"
)
// Open creates and returns an underlying sql.DB object for pgsql.

View File

@ -10,8 +10,8 @@ import (
"context"
"fmt"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/util/gutil"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/util/gutil"
)
var (

View File

@ -11,10 +11,10 @@ import (
"fmt"
"regexp"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gutil"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/text/gregex"
"github.com/gogf/gf/v3/text/gstr"
"github.com/gogf/gf/v3/util/gutil"
)
var (

View File

@ -11,9 +11,9 @@ import (
"strings"
"testing"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/test/gtest"
"github.com/gogf/gf/v3/frame/g"
"github.com/gogf/gf/v3/os/gtime"
"github.com/gogf/gf/v3/test/gtest"
)
func Test_DB_Query(t *testing.T) {

View File

@ -10,13 +10,13 @@ import (
"context"
"fmt"
_ "github.com/gogf/gf/contrib/drivers/pgsql/v2"
_ "github.com/gogf/gf/contrib/drivers/pgsql/v3"
"github.com/gogf/gf/v2/container/garray"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/test/gtest"
"github.com/gogf/gf/v3/container/garray"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/frame/g"
"github.com/gogf/gf/v3/os/gtime"
"github.com/gogf/gf/v3/test/gtest"
)
const (

View File

@ -10,10 +10,10 @@ import (
"fmt"
"testing"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/test/gtest"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/frame/g"
"github.com/gogf/gf/v3/os/gtime"
"github.com/gogf/gf/v3/test/gtest"
)
// https://github.com/gogf/gf/issues/3330

View File

@ -11,10 +11,10 @@ import (
"fmt"
"testing"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/test/gtest"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/frame/g"
"github.com/gogf/gf/v3/os/gtime"
"github.com/gogf/gf/v3/test/gtest"
)
func Test_Model_Insert(t *testing.T) {

View File

@ -9,9 +9,9 @@ package pgsql_test
import (
"testing"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/test/gtest"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/frame/g"
"github.com/gogf/gf/v3/test/gtest"
)
func Test_Raw_Insert(t *testing.T) {

View File

@ -10,12 +10,12 @@ import (
"context"
"testing"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/test/gtest"
"github.com/gogf/gf/v3/database/gdb"
"github.com/gogf/gf/v3/frame/g"
"github.com/gogf/gf/v3/os/gctx"
"github.com/gogf/gf/v3/test/gtest"
"github.com/gogf/gf/contrib/drivers/pgsql/v2"
"github.com/gogf/gf/contrib/drivers/pgsql/v3"
)
func Test_LastInsertId(t *testing.T) {