Documentation ¶
Overview ¶
Package dbstubquery provides SQL 'stubs' loader fns that assist in testing specific SQL view logic (defined in dbschemaextra).
These functions defined in this package are not *directly* used by routing, schedule, etc. logic but rather are 'subcomponent' views often reused. Providing DB 'stubs' allows us to test these views seperatly / at a SQL view unit-test level.
Examples are testing views: caltoservice and stoptoparent
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 ¶
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.