database

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecDb added in v0.0.8

func ExecDb(ctx context.Context, db *sql.DB, query string, args ...interface{}) (sql.Result, error)

Execute a query for "INSERT", "UPDATE", or "DELETE" methods which affect rows.

func NewDbClient

func NewDbClient(ctx context.Context, server string, port int, database string) (*sql.DB, error)

Create a database connection using the database name, server, and port. Must be logged in to azure cli.

func NewDbClientWithConnectionString

func NewDbClientWithConnectionString(ctx context.Context, connectionstring string) (*sql.DB, error)

Create a dabatase connection using a connection string.

func QueryDb

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

Query the database, appropriate for "SELECT" methods.

Types

type NoRowsAffectedError added in v0.0.40

type NoRowsAffectedError struct{}

func (*NoRowsAffectedError) Error added in v0.0.40

func (e *NoRowsAffectedError) Error() string

Implementing the Error() method to satisfy the error interface

Jump to

Keyboard shortcuts

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