Skip to content

Commit 7ae311a

Browse files
committed
chore: use any in place of interface{}
Signed-off-by: Prajwal S N <[email protected]>
1 parent 03343f1 commit 7ae311a

File tree

1,029 files changed

+3062
-3062
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,029 files changed

+3062
-3062
lines changed

docs/howto/delete.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
)
2020

2121
type DBTX interface {
22-
ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
22+
ExecContext(context.Context, string, ...any) (sql.Result, error)
2323
}
2424

2525
func New(db DBTX) *Queries {

docs/howto/insert.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
)
2020

2121
type DBTX interface {
22-
ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
22+
ExecContext(context.Context, string, ...any) (sql.Result, error)
2323
}
2424

2525
func New(db DBTX) *Queries {

docs/howto/prepared_query.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type Record struct {
3535

3636
type DBTX interface {
3737
PrepareContext(context.Context, string) (*sql.Stmt, error)
38-
QueryRowContext(context.Context, string, ...interface{}) *sql.Row
38+
QueryRowContext(context.Context, string, ...any) *sql.Row
3939
}
4040

4141
func New(db DBTX) *Queries {
@@ -51,7 +51,7 @@ func Prepare(ctx context.Context, db DBTX) (*Queries, error) {
5151
return &q, nil
5252
}
5353

54-
func (q *Queries) queryRow(ctx context.Context, stmt *sql.Stmt, query string, args ...interface{}) *sql.Row {
54+
func (q *Queries) queryRow(ctx context.Context, stmt *sql.Stmt, query string, args ...any) *sql.Row {
5555
switch {
5656
case stmt != nil && q.tx != nil:
5757
return q.tx.StmtContext(ctx, stmt).QueryRowContext(ctx, args...)

docs/howto/query_count.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
)
2525

2626
type DBTX interface {
27-
QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
28-
QueryRowContext(context.Context, string, ...interface{}) *sql.Row
27+
QueryContext(context.Context, string, ...any) (*sql.Rows, error)
28+
QueryRowContext(context.Context, string, ...any) *sql.Row
2929
}
3030

3131
func New(db DBTX) *Queries {

docs/howto/select.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ type Author struct {
5454
}
5555

5656
type DBTX interface {
57-
QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
58-
QueryRowContext(context.Context, string, ...interface{}) *sql.Row
57+
QueryContext(context.Context, string, ...any) (*sql.Rows, error)
58+
QueryRowContext(context.Context, string, ...any) *sql.Row
5959
}
6060

6161
func New(db DBTX) *Queries {
@@ -146,7 +146,7 @@ import (
146146
)
147147

148148
type DBTX interface {
149-
QueryRowContext(context.Context, string, ...interface{}) *sql.Row
149+
QueryRowContext(context.Context, string, ...any) *sql.Row
150150
}
151151

152152
func New(db DBTX) *Queries {
@@ -228,8 +228,8 @@ type Author struct {
228228
}
229229

230230
type DBTX interface {
231-
QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
232-
QueryRowContext(context.Context, string, ...interface{}) *sql.Row
231+
QueryContext(context.Context, string, ...any) (*sql.Rows, error)
232+
QueryRowContext(context.Context, string, ...any) *sql.Row
233233
}
234234

235235
func New(db DBTX) *Queries {
@@ -319,10 +319,10 @@ type Author struct {
319319
}
320320

321321
type DBTX interface {
322-
ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
322+
ExecContext(context.Context, string, ...any) (sql.Result, error)
323323
PrepareContext(context.Context, string) (*sql.Stmt, error)
324-
QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
325-
QueryRowContext(context.Context, string, ...interface{}) *sql.Row
324+
QueryContext(context.Context, string, ...any) (*sql.Rows, error)
325+
QueryRowContext(context.Context, string, ...any) *sql.Row
326326
}
327327

328328
func New(db DBTX) *Queries {
@@ -346,7 +346,7 @@ WHERE id IN (/*SLICE:ids*/?)
346346

347347
func (q *Queries) ListAuthorsByIDs(ctx context.Context, ids []int64) ([]Author, error) {
348348
sql := listAuthorsByIDs
349-
var queryParams []interface{}
349+
var queryParams []any
350350
if len(ids) == 0 {
351351
return nil, fmt.Errorf("slice ids must have at least one element")
352352
}

docs/howto/transactions.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ import (
3232
)
3333

3434
type DBTX interface {
35-
ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
35+
ExecContext(context.Context, string, ...any) (sql.Result, error)
3636
PrepareContext(context.Context, string) (*sql.Stmt, error)
37-
QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
38-
QueryRowContext(context.Context, string, ...interface{}) *sql.Row
37+
QueryContext(context.Context, string, ...any) (*sql.Rows, error)
38+
QueryRowContext(context.Context, string, ...any) *sql.Row
3939
}
4040

4141
func New(db DBTX) *Queries {

docs/howto/update.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
)
2727

2828
type DBTX interface {
29-
ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
29+
ExecContext(context.Context, string, ...any) (sql.Result, error)
3030
}
3131

3232
func New(db DBTX) *Queries {
@@ -67,7 +67,7 @@ import (
6767
)
6868

6969
type DBTX interface {
70-
ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
70+
ExecContext(context.Context, string, ...any) (sql.Result, error)
7171
}
7272

7373
func New(db DBTX) *Queries {

examples/authors/mysql/db.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/authors/postgresql/db.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/authors/sqlite/db.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/batch/postgresql/batch.go

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/batch/postgresql/db.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/batch/postgresql/models.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/booktest/mysql/db.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/booktest/mysql/models.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/booktest/postgresql/db.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/booktest/postgresql/models.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/booktest/sqlite/db.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/booktest/sqlite/query.sql.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/jets/postgresql/db.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)