database

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDbClient

func CreateDbClient(ctx context.Context) (*sql.DB, error)

func NewDbClient

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

func NewDbClientWithConnectionString

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

func QueryDb

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

TODO(mheberling): Change this to return something more digestible than sql.Rows?

Types

type DatabaseClientInterface

type DatabaseClientInterface interface {
	CreateDbClient(ctx context.Context) (DatabaseClientInterface, error)
	QueryDb(ctx context.Context, query string) (interface{}, error)
}

Jump to

Keyboard shortcuts

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