db.go 569 B

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