db

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HarmonyDB

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

func NewHarmonyDB

func NewHarmonyDB(ctx context.Context, hCfg config.HarmonyDBConfig) (*HarmonyDB, error)

NewHarmonyDB creates a new HarmonyDB instance. The url parameter should be a postgres connection string. "postgres://username:password@localhost:5433/database_name?search_path=curio"

func (*HarmonyDB) Close

func (db *HarmonyDB) Close()

func (*HarmonyDB) Exec

func (db *HarmonyDB) Exec(ctx context.Context, sql string, arguments ...any) (count int, err error)

func (*HarmonyDB) Query added in v0.0.4

func (db *HarmonyDB) Query(ctx context.Context, sql string, arguments ...any) (*Query, error)

func (*HarmonyDB) QueryRow

func (db *HarmonyDB) QueryRow(ctx context.Context, sql string, arguments ...any) Row

func (*HarmonyDB) Select

func (db *HarmonyDB) Select(ctx context.Context, sliceOfStructPtr any, sql string, arguments ...any) error

type Qry added in v0.0.4

type Qry interface {
	Next() bool
	Err() error
	Close()
	Scan(...any) error
	Values() ([]any, error)
}

type Query added in v0.0.4

type Query struct {
	Qry
}

type Row

type Row interface {
	Scan(...any) error
}

Jump to

Keyboard shortcuts

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