stillbox/pkg/database/db.go

34 lines
627 B
Go
Raw Permalink Normal View History

2024-07-15 10:12:53 -04:00
// Code generated by sqlc. DO NOT EDIT.
// versions:
2024-11-15 11:34:54 -05:00
// sqlc v1.27.0
2024-07-15 10:12:53 -04:00
package database
import (
"context"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgconn"
)
type DBTX interface {
Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
Query(context.Context, string, ...interface{}) (pgx.Rows, error)
QueryRow(context.Context, string, ...interface{}) pgx.Row
SendBatch(context.Context, *pgx.Batch) pgx.BatchResults
2024-07-15 10:12:53 -04:00
}
func New(db DBTX) *Queries {
return &Queries{db: db}
}
type Queries struct {
db DBTX
}
func (q *Queries) WithTx(tx pgx.Tx) *Queries {
return &Queries{
db: tx,
}
}