exec

package
v0.0.0-...-1c35737 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBlob

func CreateBlob(
	ctx context.Context,
	table string,
	column string,
	size int64,
	extraCols map[string]interface{},
) (int64, error)

CreateBlob inserts a new row into the specified table/column using zeroblob(size) and any extra columns you want to set. It returns the new rowID.

func Exec

func Exec(ctx context.Context, query string, params map[string]interface{}, resultFunc func(int, map[string]interface{})) error

Exec executes a single SQL statement with parameters.

func ExecMulti

func ExecMulti(ctx context.Context, queries []string, params []map[string]interface{}, resultFunc func(int, map[string]interface{})) error

Exec executes multiple SQL statements provided as separate queries with their respective parameters. Each query in the `queries` slice corresponds to the parameters in the `params` slice by index.

func ExecMultiTx

func ExecMultiTx(ctx context.Context, queries []string, params []map[string]interface{}, resultFunc func(int, map[string]interface{})) error

ExecTx executes multiple SQL statements within a single transaction. Each query in the `queries` slice corresponds to the parameters in the `params` slice by index.

func StreamReadBlob

func StreamReadBlob(
	ctx context.Context,
	table string,
	column string,
	rowID int64,
	offset int64,
	length int64,
	w io.Writer,
) (int64, error)

StreamReadBlob reads data from the blob starting at the given offset. If length < 0 it reads to EOF.

func WriteBlobChunk

func WriteBlobChunk(
	ctx context.Context,
	table string,
	column string,
	rowID int64,
	offset int64,
	data []byte,
) error

WriteBlobChunk writes a single chunk to the blob identified by table, column and rowID. 'offset' is where this chunk should be written.

Types

This section is empty.

Jump to

Keyboard shortcuts

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