db.go 601 B

12345678910111213141516171819202122232425262728293031
  1. // Code generated by sqlc. DO NOT EDIT.
  2. // versions:
  3. // sqlc v1.27.0
  4. package booktest
  5. import (
  6. "context"
  7. "database/sql"
  8. )
  9. type DBTX interface {
  10. ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
  11. PrepareContext(context.Context, string) (*sql.Stmt, error)
  12. QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
  13. QueryRowContext(context.Context, string, ...interface{}) *sql.Row
  14. }
  15. func New(db DBTX) *Queries {
  16. return &Queries{db: db}
  17. }
  18. type Queries struct {
  19. db DBTX
  20. }
  21. func (q *Queries) WithTx(tx *sql.Tx) *Queries {
  22. return &Queries{
  23. db: tx,
  24. }
  25. }