sqlbulk

package
v3.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sqlbulk implements the shared mechanics for native SQL bulk inserts.

Index

Constants

View Source
const PlaceholderLimit = 999

PlaceholderLimit is a conservative cap that is safe for MySQL, Postgres, and both legacy and current SQLite builds. Row chunks are derived from this parameter count rather than from a fixed number of rows.

Variables

This section is empty.

Functions

func Create

func Create(
	ctx context.Context,
	adapter storage.IStorage,
	client Execer,
	dialect, requestedTarget, staticTarget string,
	items []storage.BulkItem,
	prm *create.Create,
	options ...storage.Func[*create.Create],
) (storage.BulkResult, error)

Create inserts items with native multi-row statements. A failed statement is bisected until its database error can be assigned to exact input items.

Types

type Execer

type Execer interface {
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
}

Execer is the subset of sqlx.DB used to execute a prepared bulk statement.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址