databaseutilities

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database[T any] interface {
	Query(ctx context.Context, query string, args ...any) (T, error)
	Close()
}

type PostgresConnection

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

func (*PostgresConnection) Close

func (c *PostgresConnection) Close()

func (*PostgresConnection) Query

func (c *PostgresConnection) Query(ctx context.Context, dest interface{}, query string, args ...any) error

type PostgresMockConn

type PostgresMockConn struct {
	Mock pgxmock.PgxPoolIface
}

func NewPostgresMock

func NewPostgresMock() (*PostgresMockConn, error)

func (*PostgresMockConn) Close

func (m *PostgresMockConn) Close()

func (*PostgresMockConn) Query

func (m *PostgresMockConn) Query(ctx context.Context, dest interface{}, query string, args ...any) error

type UpdateQueryResult

type UpdateQueryResult struct {
	Query string
	Args  []string
}

func BuildUpdateWithValues

func BuildUpdateWithValues(tableName string, id string, data any) (UpdateQueryResult, error)

Jump to

Keyboard shortcuts

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