package database import ( "context" "database/sql" ) // DBTX matches the interface expected by SQLC-generated code // This interface is implemented by both *sql.DB and *sql.Tx type DBTX interface { ExecContext(context.Context, string, ...interface{}) (sql.Result, error) PrepareContext(context.Context, string) (*sql.Stmt, error) QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error) QueryRowContext(context.Context, string, ...interface{}) *sql.Row } // BaseQuerier provides basic query functionality // This interface should be implemented by package-specific Queries types type BaseQuerier interface { WithTx(tx *sql.Tx) BaseQuerier } // BaseQuerierTx provides transaction functionality // This interface should be implemented by package-specific Queries types type BaseQuerierTx interface { BaseQuerier Begin(ctx context.Context) (BaseQuerierTx, error) Commit(ctx context.Context) error Rollback(ctx context.Context) error } // TransactionFunc represents a function that operates within a database transaction // This is used by the shared transaction helpers in transaction.go type TransactionFunc[Q any] func(ctx context.Context, q Q) error