bulk

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bulk

type Bulk struct {
	// contains filtered or unexported fields
}

func NewBulk

func NewBulk(ctx context.Context, db *sql.Conn, columns []string, schema string, tableName string, rowCount int, maxRowTxCommit int) (r *Bulk, err error)

func (*Bulk) Append

func (r *Bulk) Append(ctx context.Context, rows *sql.Rows) (err error)

Appends row values to internal buffer

func (*Bulk) Close

func (r *Bulk) Close() (err error)

Closes any prepared statements

func (*Bulk) Flush

func (r *Bulk) Flush(ctx context.Context) (totalRowCount int, err error)

Writes any unsaved values from buffer to database

func (*Bulk) FqSchemaTable

func (r *Bulk) FqSchemaTable(schema string, table string) string

fqSchemaTable concatenates schema and table taking into account a null schema and whether the schema and table are already quoted.

type CopyIn

type CopyIn struct {
	// contains filtered or unexported fields
}

func NewCopyIn

func NewCopyIn(ctx context.Context, conn *sql.Conn, columns []string, schema string, tableName string) (r *CopyIn, err error)

func (*CopyIn) Append

func (r *CopyIn) Append(ctx context.Context, rows *sql.Rows) (err error)

Appends row values to internal buffer

func (*CopyIn) Close

func (r *CopyIn) Close() (err error)

Closes any prepared statements

func (*CopyIn) Flush

func (r *CopyIn) Flush(ctx context.Context) (totalRowCount int, err error)

Jump to

Keyboard shortcuts

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