version 2

This commit is contained in:
John Guo
2021-10-11 21:41:56 +08:00
parent bea54b445e
commit 1bc0635f8b
1053 changed files with 2892 additions and 2892 deletions

View File

@ -10,21 +10,21 @@ package gdb
import (
"context"
"database/sql"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/v2/errors/gcode"
"time"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/os/gcmd"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/os/gcmd"
"github.com/gogf/gf/container/gvar"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/internal/intlog"
"github.com/gogf/gf/os/glog"
"github.com/gogf/gf/v2/os/glog"
"github.com/gogf/gf/container/gmap"
"github.com/gogf/gf/container/gtype"
"github.com/gogf/gf/os/gcache"
"github.com/gogf/gf/util/grand"
"github.com/gogf/gf/v2/container/gmap"
"github.com/gogf/gf/v2/container/gtype"
"github.com/gogf/gf/v2/os/gcache"
"github.com/gogf/gf/v2/util/grand"
)
// DB defines the interfaces for ORM operations.

View File

@ -11,18 +11,18 @@ import (
"context"
"database/sql"
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/internal/intlog"
"reflect"
"strings"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/internal/utils"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/utils"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/container/gvar"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/util/gconv"
)
// GetCore returns the underlying *Core object.

View File

@ -8,11 +8,11 @@ package gdb
import (
"fmt"
"github.com/gogf/gf/os/glog"
"github.com/gogf/gf/v2/os/glog"
"sync"
"time"
"github.com/gogf/gf/os/gcache"
"github.com/gogf/gf/v2/os/gcache"
)
// Config is the configuration management object.

View File

@ -10,16 +10,16 @@ import (
"strings"
"time"
"github.com/gogf/gf/util/gutil"
"github.com/gogf/gf/v2/util/gutil"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/encoding/gbinary"
"github.com/gogf/gf/v2/encoding/gbinary"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/util/gconv"
)
// convertFieldValueToLocalValue automatically checks and converts field value from database type

View File

@ -10,8 +10,8 @@ package gdb
import (
"context"
"fmt"
"github.com/gogf/gf"
"github.com/gogf/gf/net/gtrace"
"github.com/gogf/gf/v2"
"github.com/gogf/gf/v2/net/gtrace"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
@ -19,7 +19,7 @@ import (
)
const (
tracingInstrumentName = "github.com/gogf/gf/database/gdb"
tracingInstrumentName = "github.com/gogf/gf/v2/database/gdb"
tracingAttrDbType = "db.type"
tracingAttrDbHost = "db.host"
tracingAttrDbPort = "db.port"

View File

@ -9,16 +9,16 @@ package gdb
import (
"context"
"database/sql"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"reflect"
"github.com/gogf/gf/container/gtype"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/util/guid"
"github.com/gogf/gf/v2/container/gtype"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/util/gconv"
"github.com/gogf/gf/v2/util/guid"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/v2/text/gregex"
)
// TX is the struct for transaction management.

View File

@ -10,10 +10,10 @@ package gdb
import (
"context"
"database/sql"
"github.com/gogf/gf/container/gvar"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/internal/intlog"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/v2/os/gtime"
)
// Query commits one query SQL to underlying driver and returns the execution result.

View File

@ -15,16 +15,16 @@ import (
"context"
"database/sql"
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/v2/errors/gcode"
"strconv"
"strings"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/internal/intlog"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/v2/text/gregex"
)
// DriverMssql is the driver for SQL server database.

View File

@ -10,11 +10,11 @@ import (
"context"
"database/sql"
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/intlog"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
"net/url"
_ "github.com/go-sql-driver/mysql"

View File

@ -15,17 +15,17 @@ import (
"context"
"database/sql"
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/v2/errors/gcode"
"reflect"
"strconv"
"strings"
"time"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/intlog"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
)
// DriverOracle is the driver for oracle database.

View File

@ -15,14 +15,14 @@ import (
"context"
"database/sql"
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/v2/errors/gcode"
"strings"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/intlog"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/v2/text/gregex"
)
// DriverPgsql is the driver for postgresql database.

View File

@ -14,13 +14,13 @@ import (
"context"
"database/sql"
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/v2/errors/gcode"
"strings"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/os/gfile"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/intlog"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/text/gstr"
)
// DriverSqlite is the driver for sqlite database.

View File

@ -10,25 +10,25 @@ import (
"bytes"
"database/sql"
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/v2/errors/gcode"
"reflect"
"regexp"
"strings"
"time"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/internal/empty"
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/internal/utils"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/util/gmeta"
"github.com/gogf/gf/util/gutil"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/empty"
"github.com/gogf/gf/v2/internal/json"
"github.com/gogf/gf/v2/internal/utils"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/util/gmeta"
"github.com/gogf/gf/v2/util/gutil"
"github.com/gogf/gf/internal/structs"
"github.com/gogf/gf/v2/internal/structs"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
)
// iString is the type assert api for String.

View File

@ -9,12 +9,12 @@ package gdb
import (
"context"
"fmt"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/util/gconv"
"time"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/text/gstr"
)
// Model is core struct implementing the DAO for ORM.

View File

@ -7,7 +7,7 @@
package gdb
import (
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/v2/internal/intlog"
"time"
)

View File

@ -8,8 +8,8 @@ package gdb
import (
"fmt"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
"strings"
)

View File

@ -9,11 +9,11 @@ package gdb
import (
"database/sql"
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/text/gstr"
)
// Delete does "DELETE FROM ... " statement for the model.

View File

@ -8,11 +8,11 @@ package gdb
import (
"fmt"
"github.com/gogf/gf/container/gset"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/container/gset"
"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"
)
// Fields appends `fieldNamesOrMapStruct` to the operation fields of the model, multiple fields joined using char ','.

View File

@ -8,15 +8,15 @@ package gdb
import (
"database/sql"
"github.com/gogf/gf/container/gset"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/v2/container/gset"
"github.com/gogf/gf/v2/errors/gcode"
"reflect"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/util/gutil"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
"github.com/gogf/gf/v2/util/gutil"
)
// Batch sets the batch operation number for the model.

View File

@ -9,7 +9,7 @@ package gdb
import (
"fmt"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/text/gstr"
)
// isSubQuery checks and returns whether given string a sub-query sql string.

View File

@ -8,16 +8,16 @@ package gdb
import (
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"reflect"
"github.com/gogf/gf/container/gset"
"github.com/gogf/gf/container/gvar"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/container/gset"
"github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/internal/intlog"
"github.com/gogf/gf/v2/internal/json"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
)
// All does "SELECT FROM ..." statement for the model.

View File

@ -8,11 +8,11 @@ package gdb
import (
"fmt"
"github.com/gogf/gf/container/garray"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/util/gutil"
"github.com/gogf/gf/v2/container/garray"
"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/v2/util/gutil"
)
var (

View File

@ -9,13 +9,13 @@ package gdb
import (
"database/sql"
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/v2/errors/gcode"
"reflect"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
)
// Update does "UPDATE ... " statement for the model.

View File

@ -9,12 +9,12 @@ package gdb
import (
"time"
"github.com/gogf/gf/container/gset"
"github.com/gogf/gf/internal/empty"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gutil"
"github.com/gogf/gf/v2/container/gset"
"github.com/gogf/gf/v2/internal/empty"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gutil"
)
// TableFields retrieves and returns the fields information of specified table of current

View File

@ -9,14 +9,14 @@ package gdb
import (
"database/sql"
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/v2/errors/gcode"
"reflect"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/internal/structs"
"github.com/gogf/gf/internal/utils"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/structs"
"github.com/gogf/gf/v2/internal/utils"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
)
// With creates and returns an ORM model based on metadata of given object.

View File

@ -9,10 +9,10 @@ package gdb
import (
"context"
"database/sql"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/os/gtime"
)
// Stmt is a prepared statement.

View File

@ -8,10 +8,10 @@ package gdb
import (
"database/sql"
"github.com/gogf/gf/container/gmap"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/internal/empty"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/container/gmap"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/internal/empty"
"github.com/gogf/gf/v2/util/gconv"
)
// Json converts `r` to JSON format content.

View File

@ -7,9 +7,9 @@
package gdb
import (
"github.com/gogf/gf/container/gvar"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/util/gconv"
"math"
)

View File

@ -8,11 +8,11 @@ package gdb
import (
"database/sql"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/util/gutil"
"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/v2/util/gutil"
"reflect"
)

View File

@ -10,10 +10,10 @@ import (
"context"
"testing"
"github.com/gogf/gf/container/gtype"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/container/gtype"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/test/gtest"
)
// MyDriver is a custom database driver, which is used for testing only.

View File

@ -9,8 +9,8 @@ package gdb_test
import (
"context"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
func Example_transaction() {

View File

@ -9,13 +9,13 @@ package gdb_test
import (
"context"
"fmt"
"github.com/gogf/gf/container/garray"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gcmd"
"github.com/gogf/gf/v2/container/garray"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gcmd"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/test/gtest"
)
const (

View File

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

View File

@ -8,12 +8,12 @@ package gdb_test
import (
"fmt"
"github.com/gogf/gf/debug/gdebug"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gfile"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gmeta"
"github.com/gogf/gf/v2/debug/gdebug"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/test/gtest"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gmeta"
"testing"
)

View File

@ -8,8 +8,8 @@ package gdb_test
import (
"github.com/go-sql-driver/mysql"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/test/gtest"
"testing"
)

View File

@ -10,8 +10,8 @@ import (
"context"
"testing"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_Ctx(t *testing.T) {

View File

@ -8,9 +8,9 @@ package gdb_test
import (
"fmt"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/test/gtest"
"testing"
)

View File

@ -9,10 +9,10 @@ package gdb
import (
"context"
"fmt"
"github.com/gogf/gf/container/gvar"
"github.com/gogf/gf/os/gcmd"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/os/gcmd"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/test/gtest"
"testing"
)

View File

@ -9,18 +9,18 @@ package gdb_test
import (
"context"
"fmt"
"github.com/gogf/gf/container/garray"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/container/garray"
"github.com/gogf/gf/v2/text/gstr"
"testing"
"time"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/encoding/gxml"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/encoding/gxml"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_DB_Ping(t *testing.T) {

View File

@ -11,23 +11,23 @@ import (
"context"
"database/sql"
"fmt"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/text/gstr"
"os"
"testing"
"time"
"github.com/gogf/gf/container/garray"
"github.com/gogf/gf/container/gmap"
"github.com/gogf/gf/debug/gdebug"
"github.com/gogf/gf/os/gfile"
"github.com/gogf/gf/util/gutil"
"github.com/gogf/gf/v2/container/garray"
"github.com/gogf/gf/v2/container/gmap"
"github.com/gogf/gf/v2/debug/gdebug"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/util/gutil"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_Model_Insert(t *testing.T) {

View File

@ -7,11 +7,11 @@
package gdb_test
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/v2/frame/g"
"testing"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_Insert_Raw(t *testing.T) {

View File

@ -8,14 +8,14 @@ package gdb_test
import (
"database/sql"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"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/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/test/gtest"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
"reflect"
"testing"
)

View File

@ -7,10 +7,10 @@
package gdb_test
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/v2/frame/g"
"testing"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_Model_SubQuery_Where(t *testing.T) {

View File

@ -8,13 +8,13 @@ package gdb_test
import (
"fmt"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/v2/os/gtime"
"testing"
"time"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/test/gtest"
)
// CreateAt/UpdateAt/DeleteAt

View File

@ -9,15 +9,15 @@ package gdb_test
import (
"context"
"fmt"
"github.com/gogf/gf/os/gctx"
"github.com/gogf/gf/v2/os/gctx"
"testing"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_TX_Query(t *testing.T) {

View File

@ -8,12 +8,12 @@ package gdb_test
import (
"fmt"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/v2/os/gtime"
"testing"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/test/gtest"
)
// All types testing.

View File

@ -7,10 +7,10 @@
package gdb_test
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/v2/frame/g"
"testing"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_Union(t *testing.T) {

View File

@ -7,7 +7,7 @@
package gdb
import (
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/test/gtest"
"testing"
)

View File

@ -14,8 +14,8 @@
package gredis
import (
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
)
// New creates and returns a redis client.

View File

@ -8,7 +8,7 @@ package gredis
import (
"context"
"github.com/gogf/gf/container/gvar"
"github.com/gogf/gf/v2/container/gvar"
)
// Adapter is an interface for universal redis operations.

View File

@ -9,7 +9,7 @@ package gredis
import (
"context"
"github.com/go-redis/redis/v8"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/text/gstr"
"time"
)

View File

@ -9,9 +9,9 @@ package gredis
import (
"context"
"github.com/go-redis/redis/v8"
"github.com/gogf/gf/container/gvar"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
)
type localAdapterGoRedisConn struct {

View File

@ -9,13 +9,13 @@ package gredis
import (
"context"
"crypto/tls"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/intlog"
"time"
"github.com/gogf/gf/container/gmap"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/container/gmap"
"github.com/gogf/gf/v2/util/gconv"
)
// Config is redis configuration.

View File

@ -8,8 +8,8 @@ package gredis
import (
"context"
"github.com/gogf/gf/container/gmap"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/v2/container/gmap"
"github.com/gogf/gf/v2/internal/intlog"
)
var (

View File

@ -8,10 +8,10 @@ package gredis
import (
"context"
"github.com/gogf/gf/container/gvar"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/intlog"
)
// Redis client.

View File

@ -8,9 +8,9 @@ package gredis
import (
"context"
"github.com/gogf/gf/container/gvar"
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/internal/json"
"github.com/gogf/gf/v2/os/gtime"
"reflect"
)

View File

@ -9,9 +9,9 @@ package gredis
import (
"context"
"fmt"
"github.com/gogf/gf"
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/net/gtrace"
"github.com/gogf/gf/v2"
"github.com/gogf/gf/v2/internal/json"
"github.com/gogf/gf/v2/net/gtrace"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
@ -27,7 +27,7 @@ type tracingItem struct {
}
const (
tracingInstrumentName = "github.com/gogf/gf/database/gredis"
tracingInstrumentName = "github.com/gogf/gf/v2/database/gredis"
tracingAttrRedisAddress = "redis.address"
tracingAttrRedisDb = "redis.db"
tracingEventRedisExecution = "redis.execution"

View File

@ -9,9 +9,9 @@ package gredis_test
import (
"context"
"fmt"
"github.com/gogf/gf/container/gvar"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/util/gutil"
"github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/util/gutil"
)
func Example_autoMarshalUnmarshalMap() {

View File

@ -7,9 +7,9 @@
package gredis_test
import (
"github.com/gogf/gf/database/gredis"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/database/gredis"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/test/gtest"
"testing"
"time"
)

View File

@ -8,8 +8,8 @@ package gredis_test
import (
"context"
"github.com/gogf/gf/database/gredis"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/database/gredis"
"github.com/gogf/gf/v2/test/gtest"
"testing"
)

View File

@ -7,18 +7,18 @@
package gredis_test
import (
"github.com/gogf/gf/container/gvar"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/util/guid"
"github.com/gogf/gf/util/gutil"
"github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/util/guid"
"github.com/gogf/gf/v2/util/gutil"
"testing"
"time"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/util/gconv"
"github.com/gogf/gf/database/gredis"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/database/gredis"
"github.com/gogf/gf/v2/test/gtest"
)
var (