ls преди 1 месец
родител
ревизия
20a3ed1d07
променени са 11 файла, в които са добавени 99 реда и са изтрити 88 реда
  1. 19 17
      binding/binding.go
  2. 3 3
      binding/form.go
  3. 1 2
      binding/header.go
  4. 1 1
      binding/json.go
  5. 4 1
      binding/msgpack.go
  6. 3 1
      binding/protobuf.go
  7. 1 1
      binding/query.go
  8. 1 1
      binding/uri.go
  9. 1 1
      binding/xml.go
  10. 4 1
      binding/yaml.go
  11. 61 59
      db/db.go

+ 19 - 17
binding/binding.go

@@ -41,11 +41,13 @@ var (
 	Query         = queryBinding{}
 	FormPost      = formPostBinding{}
 	FormMultipart = formMultipartBinding{}
-	ProtoBuf      = protobufBinding{}
-	MsgPack       = msgpackBinding{}
-	YAML          = yamlBinding{}
-	URI           = uriBinding{}
-	Header        = headerBinding{}
+	/*
+		ProtoBuf      = protobufBinding{}
+		MsgPack       = msgpackBinding{}
+		YAML          = yamlBinding{}
+		//*/
+	URI    = uriBinding{}
+	Header = headerBinding{}
 )
 
 // Default returns the appropriate Binding instance based on the HTTP method
@@ -60,12 +62,14 @@ func Default(method, contentType string) Binding {
 		return JSON
 	case MIMEXML, MIMEXML2:
 		return XML
-	case MIMEPROTOBUF:
-		return ProtoBuf
-	case MIMEMSGPACK, MIMEMSGPACK2:
-		return MsgPack
-	case MIMEYAML:
-		return YAML
+	/*
+		case MIMEPROTOBUF:
+			return ProtoBuf
+		case MIMEMSGPACK, MIMEMSGPACK2:
+			return MsgPack
+		case MIMEYAML:
+			return YAML
+		//*/
 	case MIMEMultipartPOSTForm:
 		return FormMultipart
 	default: // case MIMEPOSTForm:
@@ -73,14 +77,12 @@ func Default(method, contentType string) Binding {
 	}
 }
 
-func validate(obj interface{}) error {
-	return nil
-}
-
 // Bind checks the Content-Type to select a binding engine automatically,
 // Depending the "Content-Type" header different bindings are used:
-//     "application/json" --> JSON binding
-//     "application/xml"  --> XML binding
+//
+//	"application/json" --> JSON binding
+//	"application/xml"  --> XML binding
+//
 // otherwise --> returns an error.
 // It parses the request's body as JSON if Content-Type == "application/json" using JSON or XML as a JSON input.
 // It decodes the json payload into the struct specified as a pointer.

+ 3 - 3
binding/form.go

@@ -30,7 +30,7 @@ func (formBinding) Bind(req *http.Request, obj interface{}) error {
 	if err := mapForm(obj, req.Form); err != nil {
 		return err
 	}
-	return validate(obj)
+	return nil
 }
 
 func (formPostBinding) Name() string {
@@ -44,7 +44,7 @@ func (formPostBinding) Bind(req *http.Request, obj interface{}) error {
 	if err := mapForm(obj, req.PostForm); err != nil {
 		return err
 	}
-	return validate(obj)
+	return nil
 }
 
 func (formMultipartBinding) Name() string {
@@ -59,5 +59,5 @@ func (formMultipartBinding) Bind(req *http.Request, obj interface{}) error {
 		return err
 	}
 
-	return validate(obj)
+	return nil
 }

+ 1 - 2
binding/header.go

@@ -13,12 +13,11 @@ func (headerBinding) Name() string {
 }
 
 func (headerBinding) Bind(req *http.Request, obj interface{}) error {
-
 	if err := mapHeader(obj, req.Header); err != nil {
 		return err
 	}
 
-	return validate(obj)
+	return nil
 }
 
 func mapHeader(ptr interface{}, h map[string][]string) error {

+ 1 - 1
binding/json.go

@@ -51,5 +51,5 @@ func decodeJSON(r io.Reader, obj interface{}) error {
 	if err := decoder.Decode(obj); err != nil {
 		return err
 	}
-	return validate(obj)
+	return nil
 }

+ 4 - 1
binding/msgpack.go

@@ -2,10 +2,12 @@
 // Use of this source code is governed by a MIT style
 // license that can be found in the LICENSE file.
 
+//go:build !nomsgpack
 // +build !nomsgpack
 
 package binding
 
+/*
 import (
 	"bytes"
 	"io"
@@ -33,5 +35,6 @@ func decodeMsgPack(r io.Reader, obj interface{}) error {
 	if err := codec.NewDecoder(r, cdc).Decode(&obj); err != nil {
 		return err
 	}
-	return validate(obj)
+	return nil
 }
+//*/

+ 3 - 1
binding/protobuf.go

@@ -4,11 +4,12 @@
 
 package binding
 
+/*
 import (
 	"io"
 	"net/http"
 
-	"github.com/golang/protobuf/proto"
+	"google.golang.org/protobuf/proto"
 )
 
 type protobufBinding struct{}
@@ -34,3 +35,4 @@ func (protobufBinding) BindBody(body []byte, obj interface{}) error {
 	return nil
 	// return validate(obj)
 }
+// */

+ 1 - 1
binding/query.go

@@ -17,5 +17,5 @@ func (queryBinding) Bind(req *http.Request, obj interface{}) error {
 	if err := mapForm(obj, values); err != nil {
 		return err
 	}
-	return validate(obj)
+	return nil
 }

+ 1 - 1
binding/uri.go

@@ -14,5 +14,5 @@ func (uriBinding) BindURI(m map[string][]string, obj interface{}) error {
 	if err := mapURI(obj, m); err != nil {
 		return err
 	}
-	return validate(obj)
+	return nil
 }

+ 1 - 1
binding/xml.go

@@ -29,5 +29,5 @@ func decodeXML(r io.Reader, obj interface{}) error {
 	if err := decoder.Decode(obj); err != nil {
 		return err
 	}
-	return validate(obj)
+	return nil
 }

+ 4 - 1
binding/yaml.go

@@ -4,6 +4,7 @@
 
 package binding
 
+/*
 import (
 	"bytes"
 	"io"
@@ -31,5 +32,7 @@ func decodeYAML(r io.Reader, obj interface{}) error {
 	if err := decoder.Decode(obj); err != nil {
 		return err
 	}
-	return validate(obj)
+	return nil
 }
+
+// */

+ 61 - 59
db/db.go

@@ -9,9 +9,9 @@ import (
 	// PostgreSQL
 	_ "github.com/lib/pq"
 	// MySQL
-	_ "github.com/go-sql-driver/mysql"
+	//_ "github.com/go-sql-driver/mysql"
 	"github.com/jmoiron/sqlx"
-	_ "github.com/mattn/go-sqlite3"
+	//_ "github.com/mattn/go-sqlite3"
 )
 
 // DB define
@@ -215,7 +215,7 @@ func (d *DB) Rollback() (err error) {
 }
 
 // TransExec trans execute with named args
-func (d *DB) TransExec(query string, args interface{}) (lastInsertId, rowsAffected int64, err error) {
+func (d *DB) TransExec(query string, args any) (lastInsertId, rowsAffected int64, err error) {
 	var rs sql.Result
 	if rs, err = d.tx.NamedExec(query, args); err == nil {
 		rowsAffected, _ = rs.RowsAffected()
@@ -225,7 +225,7 @@ func (d *DB) TransExec(query string, args interface{}) (lastInsertId, rowsAffect
 }
 
 // TransExec trans execute with named args
-func (d *DB) TransExecContext(ctx context.Context, query string, args interface{}) (lastInsertId, rowsAffected int64, err error) {
+func (d *DB) TransExecContext(ctx context.Context, query string, args any) (lastInsertId, rowsAffected int64, err error) {
 	var rs sql.Result
 	if rs, err = d.tx.NamedExecContext(ctx, query, args); err == nil {
 		rowsAffected, _ = rs.RowsAffected()
@@ -235,7 +235,7 @@ func (d *DB) TransExecContext(ctx context.Context, query string, args interface{
 }
 
 // TransUpdate trans update
-func (d *DB) TransUpdate(query string, args interface{}) (reply Reply) {
+func (d *DB) TransUpdate(query string, args any) (reply Reply) {
 	var (
 		err error
 		rs  sql.Result
@@ -251,7 +251,7 @@ func (d *DB) TransUpdate(query string, args interface{}) (reply Reply) {
 }
 
 // TransRow trans get row
-func (d *DB) TransRow(dest interface{}, query string, args interface{}) (err error) {
+func (d *DB) TransRow(dest any, query string, args any) (err error) {
 	nstmt := &sqlx.NamedStmt{}
 	nstmt, err = d.tx.PrepareNamed(query)
 	if err != nil {
@@ -289,7 +289,7 @@ func (d *DB) PrepareNamedContext(ctx context.Context, query string) (stmt *Named
 }
 
 // Select select
-func (d *DB) Select(dest interface{}, query string, args ...interface{}) (err error) {
+func (d *DB) Select(dest any, query string, args ...any) (err error) {
 	err = d.Connect()
 	if err != nil {
 		return err
@@ -301,7 +301,7 @@ func (d *DB) Select(dest interface{}, query string, args ...interface{}) (err er
 }
 
 // SelectContext select
-func (d *DB) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) (err error) {
+func (d *DB) SelectContext(ctx context.Context, dest any, query string, args ...any) (err error) {
 	err = d.ConnectContext(ctx)
 	if err != nil {
 		return
@@ -312,8 +312,8 @@ func (d *DB) SelectContext(ctx context.Context, dest interface{}, query string,
 	return
 }
 
-// Query get rows with named args, Query executes a query that returns rows, typically a SELECT. The args are for any placeholder parameters in the query.
-func (d *DB) Query(dest interface{}, query string, args interface{}) (err error) {
+// QueryNamed get rows with named args, Query executes a query that returns rows, typically a SELECT. The args are for any placeholder parameters in the query.
+func (d *DB) QueryNamed(dest any, query string, args any) (err error) {
 	err = d.Connect()
 	if err != nil {
 		return err
@@ -331,8 +331,8 @@ func (d *DB) Query(dest interface{}, query string, args interface{}) (err error)
 	return
 }
 
-// QueryContext get rows with named args, QueryContext executes a query that returns rows, typically a SELECT. The args are for any placeholder parameters in the query.
-func (d *DB) QueryContext(ctx context.Context, dest interface{}, query string, args interface{}) (err error) {
+// QueryNamedContext get rows with named args, QueryContext executes a query that returns rows, typically a SELECT. The args are for any placeholder parameters in the query.
+func (d *DB) QueryNamedContext(ctx context.Context, dest any, query string, args any) (err error) {
 	err = d.ConnectContext(ctx)
 	if err != nil {
 		return
@@ -351,7 +351,7 @@ func (d *DB) QueryContext(ctx context.Context, dest interface{}, query string, a
 }
 
 // Rows get rows with named args
-func (d *DB) Rows(dest interface{}, query string, args interface{}) (err error) {
+func (d *DB) Rows(dest any, query string, args any) (err error) {
 	err = d.Connect()
 	if err != nil {
 		return
@@ -370,7 +370,7 @@ func (d *DB) Rows(dest interface{}, query string, args interface{}) (err error)
 }
 
 // RowsContext get rows with named args
-func (d *DB) RowsContext(ctx context.Context, dest interface{}, query string, args interface{}) (err error) {
+func (d *DB) RowsContext(ctx context.Context, dest any, query string, args any) (err error) {
 	err = d.ConnectContext(ctx)
 	if err != nil {
 		return
@@ -389,7 +389,7 @@ func (d *DB) RowsContext(ctx context.Context, dest interface{}, query string, ar
 }
 
 // QueryRow get row, QueryRow executes a query that is expected to return at most one row.
-func (d *DB) QueryRow(dest interface{}, query string, args ...interface{}) (err error) {
+func (d *DB) QueryRow(dest any, query string, args ...any) (err error) {
 	err = d.Connect()
 	if err != nil {
 		return err
@@ -401,7 +401,7 @@ func (d *DB) QueryRow(dest interface{}, query string, args ...interface{}) (err
 }
 
 // QueryRowContext get row, QueryRowContext executes a query that is expected to return at most one row.
-func (d *DB) QueryRowContext(ctx context.Context, dest interface{}, query string, args ...interface{}) (err error) {
+func (d *DB) QueryRowContext(ctx context.Context, dest any, query string, args ...any) (err error) {
 	err = d.ConnectContext(ctx)
 	if err != nil {
 		return
@@ -413,7 +413,7 @@ func (d *DB) QueryRowContext(ctx context.Context, dest interface{}, query string
 }
 
 // Get get row, QueryRow executes a query that is expected to return at most one row.
-func (d *DB) Get(dest interface{}, query string, args ...interface{}) (err error) {
+func (d *DB) Get(dest any, query string, args ...any) (err error) {
 	err = d.Connect()
 	if err != nil {
 		return
@@ -425,7 +425,7 @@ func (d *DB) Get(dest interface{}, query string, args ...interface{}) (err error
 }
 
 // GetContext get
-func (d *DB) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) (err error) {
+func (d *DB) GetContext(ctx context.Context, dest any, query string, args ...any) (err error) {
 	err = d.ConnectContext(ctx)
 	if err != nil {
 		return
@@ -437,7 +437,7 @@ func (d *DB) GetContext(ctx context.Context, dest interface{}, query string, arg
 }
 
 // Row get row with named args
-func (d *DB) Row(dest interface{}, query string, args interface{}) (err error) {
+func (d *DB) Row(dest any, query string, args any) (err error) {
 	err = d.Connect()
 	if err != nil {
 		return
@@ -456,7 +456,7 @@ func (d *DB) Row(dest interface{}, query string, args interface{}) (err error) {
 }
 
 // RowContext get row with named args
-func (d *DB) RowContext(ctx context.Context, dest interface{}, query string, args interface{}) (err error) {
+func (d *DB) RowContext(ctx context.Context, dest any, query string, args any) (err error) {
 	err = d.ConnectContext(ctx)
 	if err != nil {
 		return
@@ -476,7 +476,7 @@ func (d *DB) RowContext(ctx context.Context, dest interface{}, query string, arg
 
 // *
 // In expands slice values in args, returning the modified query string and a new arg list that can be executed by a database. The `query` should use the `?` bindVar. The return value uses the `?` bindVar.
-func (d *DB) In(query string, args ...interface{}) (q string, params []interface{}, err error) {
+func (d *DB) In(query string, args ...any) (q string, params []any, err error) {
 	err = d.Connect()
 	if err != nil {
 		return
@@ -491,7 +491,7 @@ func (d *DB) In(query string, args ...interface{}) (q string, params []interface
 //*/
 
 // InsertReply insert and return DbReply
-func (d *DB) InsertReply(query string, args interface{}) (reply Reply) {
+func (d *DB) InsertReply(query string, args any) (reply Reply) {
 	var (
 		err error
 		rs  sql.Result
@@ -514,7 +514,7 @@ func (d *DB) InsertReply(query string, args interface{}) (reply Reply) {
 }
 
 // UpdateReply update/delete and return DbReply
-func (d *DB) UpdateReply(query string, args interface{}) (reply Reply) {
+func (d *DB) UpdateReply(query string, args any) (reply Reply) {
 	var (
 		err error
 		rs  sql.Result
@@ -536,7 +536,7 @@ func (d *DB) UpdateReply(query string, args interface{}) (reply Reply) {
 }
 
 // Insert insert into with named args
-func (d *DB) Insert(query string, args interface{}) (lastInsertId, rowsAffected int64, err error) {
+func (d *DB) Insert(query string, args any) (lastInsertId, rowsAffected int64, err error) {
 	err = d.Connect()
 	if err != nil {
 		return
@@ -552,7 +552,7 @@ func (d *DB) Insert(query string, args interface{}) (lastInsertId, rowsAffected
 }
 
 // InsertContext insert into with named args
-func (d *DB) InsertContext(ctx context.Context, query string, args interface{}) (lastInsertId, rowsAffected int64, err error) {
+func (d *DB) InsertContext(ctx context.Context, query string, args any) (lastInsertId, rowsAffected int64, err error) {
 	err = d.ConnectContext(ctx)
 	if err != nil {
 		return
@@ -568,7 +568,7 @@ func (d *DB) InsertContext(ctx context.Context, query string, args interface{})
 }
 
 // Update update/delete with named args
-func (d *DB) Update(query string, args interface{}) (rowsAffected int64, err error) {
+func (d *DB) Update(query string, args any) (rowsAffected int64, err error) {
 	err = d.Connect()
 	if err != nil {
 		return
@@ -583,7 +583,7 @@ func (d *DB) Update(query string, args interface{}) (rowsAffected int64, err err
 }
 
 // Update update/delete with named args
-func (d *DB) UpdateContext(ctx context.Context, query string, args interface{}) (rowsAffected int64, err error) {
+func (d *DB) UpdateContext(ctx context.Context, query string, args any) (rowsAffected int64, err error) {
 	err = d.ConnectContext(ctx)
 	if err != nil {
 		return
@@ -598,7 +598,7 @@ func (d *DB) UpdateContext(ctx context.Context, query string, args interface{})
 }
 
 // Exec exec
-func (d *DB) Exec(query string, args ...interface{}) (lastInsertId, rowsAffected int64, err error) {
+func (d *DB) Exec(query string, args ...any) (lastInsertId, rowsAffected int64, err error) {
 	err = d.Connect()
 	if err != nil {
 		return
@@ -614,7 +614,7 @@ func (d *DB) Exec(query string, args ...interface{}) (lastInsertId, rowsAffected
 }
 
 // ExecContext exec
-func (d *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (lastInsertId, rowsAffected int64, err error) {
+func (d *DB) ExecContext(ctx context.Context, query string, args ...any) (lastInsertId, rowsAffected int64, err error) {
 	err = d.ConnectContext(ctx)
 	if err != nil {
 		return
@@ -630,7 +630,7 @@ func (d *DB) ExecContext(ctx context.Context, query string, args ...interface{})
 }
 
 // Exec exec, with named args
-func (d *DB) NamedExec(query string, args interface{}) (lastInsertId, rowsAffected int64, err error) {
+func (d *DB) NamedExec(query string, args any) (lastInsertId, rowsAffected int64, err error) {
 	err = d.Connect()
 	if err != nil {
 		return
@@ -646,7 +646,7 @@ func (d *DB) NamedExec(query string, args interface{}) (lastInsertId, rowsAffect
 }
 
 // NamedExecContext exec, with named args
-func (d *DB) NamedExecContext(ctx context.Context, query string, args interface{}) (lastInsertId, rowsAffected int64, err error) {
+func (d *DB) NamedExecContext(ctx context.Context, query string, args any) (lastInsertId, rowsAffected int64, err error) {
 	err = d.ConnectContext(ctx)
 	if err != nil {
 		return
@@ -663,11 +663,13 @@ func (d *DB) NamedExecContext(ctx context.Context, query string, args interface{
 
 // Limit MySQL limit
 func (d *DB) Limit(page, pagesize int) string {
-	// MySQL limit 0, size
-	if d.Driver == `mysql` {
-		return fmt.Sprintf(" LIMIT %d, %d", (page-1)*pagesize, pagesize)
-	}
-	// // PostgreSQL limit size offset 0
+	/*
+		// MySQL limit 0, size
+		if d.Driver == `mysql` {
+			return fmt.Sprintf(" LIMIT %d, %d", (page-1)*pagesize, pagesize)
+		}
+		// // PostgreSQL limit size offset 0
+		// */
 	return fmt.Sprintf(" LIMIT %d OFFSET %d", pagesize, (page-1)*pagesize)
 }
 
@@ -682,7 +684,7 @@ func (t *Tx) Rollback() error {
 }
 
 // NamedExec executes a query that doesn't return rows. For example: an INSERT and UPDATE. with named args
-func (t *Tx) NamedExec(query string, args interface{}) (lastInsertId, rowsAffected int64, err error) {
+func (t *Tx) NamedExec(query string, args any) (lastInsertId, rowsAffected int64, err error) {
 	var rs sql.Result
 	if rs, err = t.tx.NamedExec(query, args); err == nil {
 		rowsAffected, _ = rs.RowsAffected()
@@ -692,7 +694,7 @@ func (t *Tx) NamedExec(query string, args interface{}) (lastInsertId, rowsAffect
 }
 
 // NamedExecContext executes a query that doesn't return rows. For example: an INSERT and UPDATE. with named args
-func (t *Tx) NamedExecContext(ctx context.Context, query string, args interface{}) (lastInsertId, rowsAffected int64, err error) {
+func (t *Tx) NamedExecContext(ctx context.Context, query string, args any) (lastInsertId, rowsAffected int64, err error) {
 	var rs sql.Result
 	if rs, err = t.tx.NamedExecContext(ctx, query, args); err == nil {
 		rowsAffected, _ = rs.RowsAffected()
@@ -702,7 +704,7 @@ func (t *Tx) NamedExecContext(ctx context.Context, query string, args interface{
 }
 
 // Exec executes a query that doesn't return rows. For example: an INSERT and UPDATE.
-func (t *Tx) Exec(query string, args ...interface{}) (lastInsertId, rowsAffected int64, err error) {
+func (t *Tx) Exec(query string, args ...any) (lastInsertId, rowsAffected int64, err error) {
 	var rs sql.Result
 	if rs, err = t.tx.Exec(query, args...); err == nil {
 		rowsAffected, _ = rs.RowsAffected()
@@ -712,7 +714,7 @@ func (t *Tx) Exec(query string, args ...interface{}) (lastInsertId, rowsAffected
 }
 
 // ExecContext executes a query that doesn't return rows. For example: an INSERT and UPDATE.
-func (t *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (lastInsertId, rowsAffected int64, err error) {
+func (t *Tx) ExecContext(ctx context.Context, query string, args ...any) (lastInsertId, rowsAffected int64, err error) {
 	var rs sql.Result
 	if rs, err = t.tx.ExecContext(ctx, query, args...); err == nil {
 		rowsAffected, _ = rs.RowsAffected()
@@ -746,7 +748,7 @@ func (t *Tx) PrepareNamedContext(ctx context.Context, query string) (stmt *Named
 }
 
 // Query executes a query that returns rows, typically a SELECT. with named args
-func (t *Tx) Query(dest interface{}, query string, args interface{}) (err error) {
+func (t *Tx) Query(dest any, query string, args any) (err error) {
 	nstmt := &sqlx.NamedStmt{}
 	nstmt, err = t.tx.PrepareNamed(query)
 	if err != nil {
@@ -759,7 +761,7 @@ func (t *Tx) Query(dest interface{}, query string, args interface{}) (err error)
 }
 
 // QueryContext executes a query that returns rows, typically a SELECT. with named args
-func (t *Tx) QueryContext(ctx context.Context, dest interface{}, query string, args interface{}) (err error) {
+func (t *Tx) QueryContext(ctx context.Context, dest any, query string, args any) (err error) {
 	nstmt := &sqlx.NamedStmt{}
 	nstmt, err = t.tx.PrepareNamedContext(ctx, query)
 	if err != nil {
@@ -772,7 +774,7 @@ func (t *Tx) QueryContext(ctx context.Context, dest interface{}, query string, a
 }
 
 // QueryRow executes a query that returns rows, typically a SELECT. with named args
-func (t *Tx) QueryRow(dest interface{}, query string, args interface{}) (err error) {
+func (t *Tx) QueryRow(dest any, query string, args any) (err error) {
 	nstmt := &sqlx.NamedStmt{}
 	nstmt, err = t.tx.PrepareNamed(query)
 	if err != nil {
@@ -785,7 +787,7 @@ func (t *Tx) QueryRow(dest interface{}, query string, args interface{}) (err err
 }
 
 // QueryRowContext get row with named args
-func (t *Tx) QueryRowContext(ctx context.Context, dest interface{}, query string, args interface{}) (err error) {
+func (t *Tx) QueryRowContext(ctx context.Context, dest any, query string, args any) (err error) {
 	nstmt := &sqlx.NamedStmt{}
 	nstmt, err = t.tx.PrepareNamedContext(ctx, query)
 	if err != nil {
@@ -831,7 +833,7 @@ func PingContext(ctx context.Context) (err error) {
 }
 
 // Select select
-func Select(dest interface{}, query string, args ...interface{}) (err error) {
+func Select(dest any, query string, args ...any) (err error) {
 	defaultDB.conn, err = connect()
 	if err != nil {
 		return err
@@ -842,7 +844,7 @@ func Select(dest interface{}, query string, args ...interface{}) (err error) {
 }
 
 // Query get rows with named args
-func Query(dest interface{}, query string, args interface{}) (err error) {
+func Query(dest any, query string, args any) (err error) {
 	defaultDB.conn, err = connect()
 	if err != nil {
 		return
@@ -860,7 +862,7 @@ func Query(dest interface{}, query string, args interface{}) (err error) {
 }
 
 // QueryContext get rows with named args
-func QueryContext(ctx context.Context, dest interface{}, query string, args interface{}) (err error) {
+func QueryContext(ctx context.Context, dest any, query string, args any) (err error) {
 	defaultDB.conn, err = connectContext(ctx)
 	if err != nil {
 		return
@@ -878,7 +880,7 @@ func QueryContext(ctx context.Context, dest interface{}, query string, args inte
 }
 
 // Rows get rows with named args
-func Rows(dest interface{}, query string, args interface{}) (err error) {
+func Rows(dest any, query string, args any) (err error) {
 	defaultDB.conn, err = connect()
 	if err != nil {
 		return
@@ -896,7 +898,7 @@ func Rows(dest interface{}, query string, args interface{}) (err error) {
 }
 
 // RowsContext get rows with named args
-func RowsContext(ctx context.Context, dest interface{}, query string, args interface{}) (err error) {
+func RowsContext(ctx context.Context, dest any, query string, args any) (err error) {
 	defaultDB.conn, err = connectContext(ctx)
 	if err != nil {
 		return
@@ -914,7 +916,7 @@ func RowsContext(ctx context.Context, dest interface{}, query string, args inter
 }
 
 // Get get
-func Get(dest interface{}, query string, args ...interface{}) (err error) {
+func Get(dest any, query string, args ...any) (err error) {
 	defaultDB.conn, err = connect()
 	if err != nil {
 		return
@@ -925,7 +927,7 @@ func Get(dest interface{}, query string, args ...interface{}) (err error) {
 }
 
 // QueryRow get row with named args
-func QueryRow(dest interface{}, query string, args interface{}) (err error) {
+func QueryRow(dest any, query string, args any) (err error) {
 	defaultDB.conn, err = connect()
 	if err != nil {
 		return
@@ -943,7 +945,7 @@ func QueryRow(dest interface{}, query string, args interface{}) (err error) {
 }
 
 // QueryRowContext get row with named args
-func QueryRowContext(ctx context.Context, dest interface{}, query string, args interface{}) (err error) {
+func QueryRowContext(ctx context.Context, dest any, query string, args any) (err error) {
 	defaultDB.conn, err = connectContext(ctx)
 	if err != nil {
 		return
@@ -961,7 +963,7 @@ func QueryRowContext(ctx context.Context, dest interface{}, query string, args i
 }
 
 // Row get row with named args
-func Row(dest interface{}, query string, args interface{}) (err error) {
+func Row(dest any, query string, args any) (err error) {
 	defaultDB.conn, err = connect()
 	if err != nil {
 		return
@@ -979,7 +981,7 @@ func Row(dest interface{}, query string, args interface{}) (err error) {
 }
 
 // RowContext get row with named args
-func RowContext(ctx context.Context, dest interface{}, query string, args interface{}) (err error) {
+func RowContext(ctx context.Context, dest any, query string, args any) (err error) {
 	defaultDB.conn, err = connectContext(ctx)
 	if err != nil {
 		return
@@ -998,7 +1000,7 @@ func RowContext(ctx context.Context, dest interface{}, query string, args interf
 
 /*
 // In expands slice values in args, returning the modified query string and a new arg list that can be executed by a database. The `query` should use the `?` bindVar. The return value uses the `?` bindVar.
-func In(query string, args ...interface{}) (q string, params []interface{}, err error) {
+func In(query string, args ...any) (q string, params []any, err error) {
 	defaultDB.conn, err = connect()
 	if err != nil {
 		return
@@ -1010,7 +1012,7 @@ func In(query string, args ...interface{}) (q string, params []interface{}, err
 // */
 
 // Exec exec
-func Exec(query string, args ...interface{}) (lastInsertId, rowsAffected int64, err error) {
+func Exec(query string, args ...any) (lastInsertId, rowsAffected int64, err error) {
 	defaultDB.conn, err = connect()
 	if err != nil {
 		return
@@ -1021,7 +1023,7 @@ func Exec(query string, args ...interface{}) (lastInsertId, rowsAffected int64,
 }
 
 // Exec exec
-func ExecContext(ctx context.Context, query string, args ...interface{}) (lastInsertId, rowsAffected int64, err error) {
+func ExecContext(ctx context.Context, query string, args ...any) (lastInsertId, rowsAffected int64, err error) {
 	defaultDB.conn, err = connectContext(ctx)
 	if err != nil {
 		return
@@ -1032,7 +1034,7 @@ func ExecContext(ctx context.Context, query string, args ...interface{}) (lastIn
 }
 
 // NamedExec exec with named args
-func NamedExec(query string, args interface{}) (lastInsertId, rowsAffected int64, err error) {
+func NamedExec(query string, args any) (lastInsertId, rowsAffected int64, err error) {
 	defaultDB.conn, err = connect()
 	if err != nil {
 		return
@@ -1043,7 +1045,7 @@ func NamedExec(query string, args interface{}) (lastInsertId, rowsAffected int64
 }
 
 // NamedExecContext exec with named args
-func NamedExecContext(ctx context.Context, query string, args interface{}) (lastInsertId, rowsAffected int64, err error) {
+func NamedExecContext(ctx context.Context, query string, args any) (lastInsertId, rowsAffected int64, err error) {
 	defaultDB.conn, err = connectContext(ctx)
 	if err != nil {
 		return