dbwrappers

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package dbwrappers contains methods that wrap the raw methods generated by sqlc and provide a nicer API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchUpdate

func BatchUpdate[T any, S batchResult](ctx context.Context, f func(ctx context.Context, args []T) S, args []T) error

func ListStopTimesForUpdate

func ListStopTimesForUpdate(ctx context.Context, querier db.Querier, tripUIDToPk map[TripUID]int64) (map[TripUID][]db.ListTripStopTimesForUpdateRow, error)

func ListTripsForUpdate

func ListTripsForUpdate(ctx context.Context, querier db.Querier, systemPk int64, routePks []int64) (map[TripUID]db.ListTripsRow, error)

func MapAgencyIDToPk

func MapAgencyIDToPk(ctx context.Context, querier db.Querier, systemPk int64) (map[string]int64, error)

func MapRouteIDToPkInSystem

func MapRouteIDToPkInSystem(ctx context.Context, querier db.Querier, systemPk int64, routeIDs ...[]string) (map[string]int64, error)

func MapScheduledTripIDToPkInSystem added in v0.6.1

func MapScheduledTripIDToPkInSystem(ctx context.Context, queries db.Querier, systemPk int64, scheduledTripIDs ...[]string) (map[string]int64, error)

func MapScheduledTripIDToRoutePkInSystem added in v0.6.1

func MapScheduledTripIDToRoutePkInSystem(ctx context.Context, queries db.Querier, systemPk int64, scheduledTripIDs ...[]string) (map[string]int64, error)

func MapStopIDToPkInSystem

func MapStopIDToPkInSystem(ctx context.Context, querier db.Querier, systemPk int64, stopIDs ...[]string) (map[string]int64, error)

func MapStopIDToStationPk

func MapStopIDToStationPk(ctx context.Context, querier db.Querier, systemPk int64) (map[string]int64, error)

func MapStopPkToChildPks

func MapStopPkToChildPks(ctx context.Context, querier db.Querier, stopPks []int64) (map[int64][]int64, error)

func MapStopPkToDescendentPks

func MapStopPkToDescendentPks(ctx context.Context, querier db.Querier, stopPks []int64) (map[int64]map[int64]bool, error)

func MapStopPkToStationPk

func MapStopPkToStationPk(ctx context.Context, querier db.Querier, systemPk int64, stopPks []int64) (map[int64]int64, error)

func MapTripIDToPkInSystem

func MapTripIDToPkInSystem(ctx context.Context, querier db.Querier, systemPk int64, tripIDs ...[]string) (map[string]int64, error)

func MapTripPkToVehicleID added in v0.6.1

func MapTripPkToVehicleID(
	ctx context.Context,
	querier db.Querier,
	systemPk int64,
	vehicleIDs []string) (map[int64]string, error)

func Ping

func Ping(ctx context.Context, logger *slog.Logger, pool *pgxpool.Pool, numRetries int, waitBetweenPings time.Duration) error

Types

type TripUID

type TripUID struct {
	ID      string
	RoutePk int64
}

Jump to

Keyboard shortcuts

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