hiling_go/db/sqlc/db.go

33 lines
564 B
Go
Raw Normal View History

2023-09-08 22:24:58 +07:00
// Code generated by sqlc. DO NOT EDIT.
// versions:
2024-08-19 07:40:01 +07:00
// sqlc v1.26.0
2023-09-08 22:24:58 +07:00
package db
import (
"context"
2024-02-06 11:55:25 +07:00
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgconn"
2023-09-08 22:24:58 +07:00
)
type DBTX interface {
2024-02-06 11:55:25 +07:00
Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
Query(context.Context, string, ...interface{}) (pgx.Rows, error)
QueryRow(context.Context, string, ...interface{}) pgx.Row
2023-09-08 22:24:58 +07:00
}
func New(db DBTX) *Queries {
return &Queries{db: db}
}
type Queries struct {
db DBTX
}
2024-02-06 11:55:25 +07:00
func (q *Queries) WithTx(tx pgx.Tx) *Queries {
2023-09-08 22:24:58 +07:00
return &Queries{
db: tx,
}
}