Documentation ¶
Overview ¶
sanitize.go is taken from https://github.com/jackc/pgx/blob/v5.5.0/internal/sanitize/sanitize.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPostgresBatcher ¶
func NewPostgresBatcher(tx *pachsql.Tx, action string, table string, columns []string, wColumns []string, batchSize int) (error, *postgresBatcher)
NewPostgresBatcher creates a new batcher.
func QuoteBytes ¶
func QuoteString ¶
Types ¶
type Part ¶
type Part any
Part is either a string or an int. A string is raw SQL. An int is a argument placeholder.
type SimplePostgresBatcher ¶
type SimplePostgresBatcher struct {
// contains filtered or unexported fields
}
SimplePostgresBatcher is an alternative batcher that buffers statements 'stmts' terminated by semicolons until it hits the max number of statements. The statements are then executed in one round-trip query to postgres.
func NewSimplePostgresBatcher ¶
func NewSimplePostgresBatcher(tx *pachsql.Tx) *SimplePostgresBatcher
func (*SimplePostgresBatcher) Add ¶
func (pb *SimplePostgresBatcher) Add(ctx context.Context, stmt string, args ...interface{}) error
Add inserts a statement to the SimplePostgresBatcher's internal buffer. If the number of statements exceeds the maximum after adding, the batcher executes the statements. SimplePostgresBatcher doesn't support buffering arguments, the arguments are sanitized then their values are inlined.
Add does not support SqlNull<X> structs like SqlNullString.