dbstubquery

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package dbstubquery provides SQL 'stubs' loader fns that aren't (directly) used by the routing logic (apirtroute) but are used implictily by larger queries.

Examples are testing views:

caltoservice and stoptoparent

These views are used as 'subcomponents' of ordinary loader queries in dbquery, however it's helpful to directly test these view functions as input/output fns directly (via the associated dbstubquery_test).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCalToService

func LoadCalToService(
	DB *sqlx.DB,
	feedID, fromDateYYYYMMDD, toDateYYYYMMDD uint,
) (*[]dbt.CalToService, error)

As such, the existance of this function is to have unit-tests for the fucntionality of determining *which* services are valid for a given input date. And to have the ability to to individually / in isolation test the functionality of the _vcaltoservice view which is responsible for this.

func LoadStopToParent

func LoadStopToParent(DB *sqlx.DB, feedID uint) (*[]dbt.StopToParent, error)

LoadStopParent loads the mapping of the stop to its 'ultimate' parent based on the underlying _vstopparent view. Given that GTFS's stops.txt provides a 'hierarchical' structure based on the parent_station, the _vstopparent view 'flattens' this and provides a mapping for each stop to its "ultimate" parent.

This loader is only used in tests, and essentially functions to provide a functional test for the view logic in _vstopparent

Types

This section is empty.

Jump to

Keyboard shortcuts

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