sqlwrapper

package
v0.0.0-...-c4f3291 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnotateStmt

func AnnotateStmt(query, marginalia string) string

AnnotateStmt annotates a single SQL statement with the configured marginalia.

*NOTE* This is NOT SAFE to use with multiple SQL statements as it naively annotates the single query string provided and does not attempt to parse the provided SQL

Types

type DB

type DB struct {
	*sqlorig.DB
	Marginalia string
}

func Open

func Open(driverName, dataSourceName, marginalia string) (*DB, error)

func (DB) Begin

func (db DB) Begin() (*Tx, error)

func (DB) Exec

func (db DB) Exec(query string, args ...interface{}) (sqlorig.Result, error)

func (DB) ExecContext

func (db DB) ExecContext(ctx context.Context, query string, args ...interface{}) (sqlorig.Result, error)

func (DB) Prepare

func (db DB) Prepare(query string) (*sqlorig.Stmt, error)

func (DB) PrepareContext

func (db DB) PrepareContext(ctx context.Context, query string) (*sqlorig.Stmt, error)

func (DB) Query

func (db DB) Query(query string, args ...interface{}) (*sqlorig.Rows, error)

func (DB) QueryContext

func (db DB) QueryContext(ctx context.Context, query string, args ...interface{}) (*sqlorig.Rows, error)

func (DB) QueryRow

func (db DB) QueryRow(query string, args ...interface{}) *sqlorig.Row

func (DB) QueryRowContext

func (db DB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sqlorig.Row

type Tx

type Tx struct {
	*sqlorig.Tx
	// contains filtered or unexported fields
}

func (Tx) Exec

func (tx Tx) Exec(query string, args ...interface{}) (sqlorig.Result, error)

func (Tx) ExecContext

func (tx Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (sqlorig.Result, error)

func (Tx) Prepare

func (tx Tx) Prepare(query string) (*sqlorig.Stmt, error)

func (Tx) PrepareContext

func (tx Tx) PrepareContext(ctx context.Context, query string) (*sqlorig.Stmt, error)

func (Tx) Query

func (tx Tx) Query(query string, args ...interface{}) (*sqlorig.Rows, error)

func (Tx) QueryContext

func (tx Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sqlorig.Rows, error)

func (Tx) QueryRow

func (tx Tx) QueryRow(query string, args ...interface{}) *sqlorig.Row

func (Tx) QueryRowContext

func (tx Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sqlorig.Row

Jump to

Keyboard shortcuts

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