intsql

package
v0.0.0-...-a24ee6e Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HelperTestMergeActivities

func HelperTestMergeActivities(
	t *testing.T,
	sdb StravaDatabase,
	activitiesSql string,
	streamsSql string)

func HelperTestUploadActivityJson

func HelperTestUploadActivityJson(t *testing.T, sdb StravaDatabase)

func LogRowResponse

func LogRowResponse(row *sql.Row, logLabel string) error

func QueryContext

func QueryContext(context context.Context, q QueryContextable, logLabel string, sqlText string) (*sql.Rows, error)

func QueryRowContext

func QueryRowContext(context context.Context, q QueryRowContextable, logLabel string, sqlText string, args ...any) *sql.Row

func ScanColumns

func ScanColumns(rows *sql.Rows, slicesOut ...any) error

scan the rows column-wise into the slices pointed to by ...any The arguments of Scan are constructed according to the types of the pointed slices. the inputs may also be a slice pointer converted to an interface{}

func ScanColumnsAndCompare

func ScanColumnsAndCompare(t *testing.T, rows *sql.Rows, expectedValsSlices ...any)

func ToJsonables

func ToJsonables(slice []StringJsonable) []util.Jsonable

Types

type QueryContextable

type QueryContextable interface {
	QueryContext(context.Context, string, ...any) (*sql.Rows, error)
}

type QueryRowContextable

type QueryRowContextable interface {
	QueryRowContext(context.Context, string, ...any) *sql.Row
}

type SqlFlags

type SqlFlags interface {
	util.Flags
	NewStravaDatabase() (StravaDatabase, error)
}

type StravaDatabase

type StravaDatabase interface {
	OpenDB() error
	DB() *sql.DB
	InitAndValidateSchema() error
	FilterKnownActivityIds(activityIds []int64) ([]int64, error)
	UploadActivityJson(activities []util.Jsonable) error
	MergeActivities() error
	Close() error
}

type StringJsonable

type StringJsonable string

func (StringJsonable) ToJson

func (sj StringJsonable) ToJson() string

Directories

Path Synopsis
functions to create and verify our schema.
functions to create and verify our schema.

Jump to

Keyboard shortcuts

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