db

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MockExecuteStatement  = "UPDATE users SET name = $1 age = $2 WHERE id = $3"
	MockExecuteParameters = []any{"John", 30, 1}

	MockQueryStatement  = "SELECT * FROM users WHERE age >= $1 and age < $2 and active = $3"
	MockQueryParameters = []any{18, 21, true}

	MockQueryScalarStatement  = "SELECT COUNT(*) FROM users WHERE age >= $1 and age < $2 and active = $3"
	MockQueryScalarParameters = []any{0, 18, false}
)
View Source
var DatabaseQueryCallStack = testutils.NewCallStack()

Functions

func Execute

func Execute(hostName, dbType, statement string, params ...any) (uint, error)

func Query

func Query[T any](hostName, dbType, statement string, params ...any) ([]T, uint, error)

func QueryScalar

func QueryScalar[T any](hostName, dbType, statement string, params ...any) (T, uint, error)

Types

type HostQueryResponse

type HostQueryResponse struct {
	Error        *string
	ResultJson   *string
	RowsAffected uint32
}

Jump to

Keyboard shortcuts

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