gtfs 4.10.4 → 4.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +57 -9
  3. package/lib/advancedQuery.js +1 -1
  4. package/lib/geojson-utils.js +7 -7
  5. package/lib/gtfs/agencies.js +2 -2
  6. package/lib/gtfs/areas.js +1 -1
  7. package/lib/gtfs/attributions.js +2 -2
  8. package/lib/gtfs/booking-rules.js +32 -0
  9. package/lib/gtfs/calendar-dates.js +2 -2
  10. package/lib/gtfs/calendars.js +2 -2
  11. package/lib/gtfs/fare-attributes.js +2 -2
  12. package/lib/gtfs/fare-leg-rules.js +2 -2
  13. package/lib/gtfs/fare-products.js +2 -2
  14. package/lib/gtfs/fare-rules.js +2 -2
  15. package/lib/gtfs/fare-transfer-rules.js +2 -2
  16. package/lib/gtfs/feed-info.js +2 -2
  17. package/lib/gtfs/frequencies.js +2 -2
  18. package/lib/gtfs/levels.js +1 -1
  19. package/lib/gtfs/location-group-stops.js +32 -0
  20. package/lib/gtfs/location-groups.js +32 -0
  21. package/lib/gtfs/pathways.js +2 -2
  22. package/lib/gtfs/routes.js +3 -3
  23. package/lib/gtfs/shapes.js +5 -5
  24. package/lib/gtfs/stop-areas.js +2 -2
  25. package/lib/gtfs/stop-times.js +2 -2
  26. package/lib/gtfs/transfers.js +2 -2
  27. package/lib/gtfs/translations.js +2 -2
  28. package/lib/gtfs/trips.js +1 -1
  29. package/lib/gtfs-plus/calendar-attributes.js +2 -2
  30. package/lib/gtfs-plus/directions.js +2 -2
  31. package/lib/gtfs-plus/route-attributes.js +2 -2
  32. package/lib/gtfs-plus/stop-attributes.js +2 -2
  33. package/lib/gtfs-realtime/service-alerts.js +2 -2
  34. package/lib/gtfs-realtime/trip-updates.js +2 -2
  35. package/lib/gtfs-realtime/vehicle-positions.js +2 -2
  36. package/lib/gtfs-ride/board-alights.js +2 -2
  37. package/lib/gtfs-ride/ride-feed-infos.js +2 -2
  38. package/lib/gtfs-ride/rider-trips.js +2 -2
  39. package/lib/gtfs-ride/riderships.js +2 -2
  40. package/lib/gtfs-ride/trip-capacities.js +2 -2
  41. package/lib/gtfs.js +12 -0
  42. package/lib/import.js +30 -22
  43. package/lib/non-standard/timetable-notes-references.js +2 -2
  44. package/lib/non-standard/timetable-notes.js +2 -2
  45. package/lib/non-standard/timetable-pages.js +2 -2
  46. package/lib/non-standard/timetable-stop-order.js +2 -2
  47. package/lib/non-standard/timetables.js +2 -2
  48. package/lib/non-standard/trips-dated-vehicle-journey.js +2 -2
  49. package/lib/ods/deadhead-times.js +2 -2
  50. package/lib/ods/deadheads.js +2 -2
  51. package/lib/ods/ops-locations.js +2 -2
  52. package/lib/ods/run-events.js +2 -2
  53. package/lib/ods/runs-pieces.js +2 -2
  54. package/models/gtfs/attributions.js +2 -2
  55. package/models/gtfs/booking-rules.js +91 -0
  56. package/models/gtfs/fare-leg-rules.js +5 -0
  57. package/models/gtfs/location-group-stops.js +21 -0
  58. package/models/gtfs/location-groups.js +18 -0
  59. package/models/gtfs/stop-times.js +33 -0
  60. package/models/models.js +6 -0
  61. package/package.json +4 -5
  62. package/test/mocha/get-agencies.js +1 -1
  63. package/test/mocha/get-booking-rules.js +28 -0
  64. package/test/mocha/get-calendar-dates.js +1 -1
  65. package/test/mocha/get-fare-rules.js +1 -1
  66. package/test/mocha/get-location-group-stops.js +33 -0
  67. package/test/mocha/get-location-groups.js +28 -0
  68. package/test/mocha/get-routes.js +2 -2
  69. package/test/mocha/get-shapes.js +6 -6
  70. package/test/mocha/get-stoptimes.js +1 -1
@@ -16,7 +16,7 @@ export function getTransfers(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(transfers.filenameBase);
@@ -26,7 +26,7 @@ export function getTransfers(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getTranslations(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(translations.filenameBase);
@@ -26,7 +26,7 @@ export function getTranslations(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
package/lib/gtfs/trips.js CHANGED
@@ -21,7 +21,7 @@ export function getTrips(query = {}, fields = [], orderBy = [], options = {}) {
21
21
 
22
22
  return db
23
23
  .prepare(
24
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
24
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
25
25
  )
26
26
  .all();
27
27
  }
@@ -16,7 +16,7 @@ export function getCalendarAttributes(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(calendarAttributes.filenameBase);
@@ -26,7 +26,7 @@ export function getCalendarAttributes(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getDirections(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(directions.filenameBase);
@@ -26,7 +26,7 @@ export function getDirections(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getRouteAttributes(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(routeAttributes.filenameBase);
@@ -26,7 +26,7 @@ export function getRouteAttributes(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getStopAttributes(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(stopAttributes.filenameBase);
@@ -26,7 +26,7 @@ export function getStopAttributes(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -17,7 +17,7 @@ export function getServiceAlerts(
17
17
  query = {},
18
18
  fields = [],
19
19
  orderBy = [],
20
- options = {}
20
+ options = {},
21
21
  ) {
22
22
  const db = options.db ?? openDb();
23
23
  const tableName = sqlString.escapeId(serviceAlerts.filenameBase);
@@ -28,7 +28,7 @@ export function getServiceAlerts(
28
28
 
29
29
  return db
30
30
  .prepare(
31
- `${selectClause} FROM ${tableName} INNER JOIN ${joinTable} ON ${tableName}.id=${joinTable}.alert_id ${whereClause} ${orderByClause};`
31
+ `${selectClause} FROM ${tableName} INNER JOIN ${joinTable} ON ${tableName}.id=${joinTable}.alert_id ${whereClause} ${orderByClause};`,
32
32
  )
33
33
  .all();
34
34
  }
@@ -16,7 +16,7 @@ export function getTripUpdates(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(tripUpdates.filenameBase);
@@ -26,7 +26,7 @@ export function getTripUpdates(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getVehiclePositions(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(vehiclePositions.filenameBase);
@@ -26,7 +26,7 @@ export function getVehiclePositions(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getBoardAlights(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(boardAlights.filenameBase);
@@ -26,7 +26,7 @@ export function getBoardAlights(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getRideFeedInfos(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(rideFeedInfo.filenameBase);
@@ -26,7 +26,7 @@ export function getRideFeedInfos(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getRiderTrips(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(riderTrip.filenameBase);
@@ -26,7 +26,7 @@ export function getRiderTrips(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getRiderships(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(riderships.filenameBase);
@@ -26,7 +26,7 @@ export function getRiderships(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getTripCapacities(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(tripCapacity.filenameBase);
@@ -26,7 +26,7 @@ export function getTripCapacities(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
package/lib/gtfs.js CHANGED
@@ -8,6 +8,7 @@ import exportGtfs from './export.js';
8
8
  import { getAgencies } from './gtfs/agencies.js';
9
9
  import { getAreas } from './gtfs/areas.js';
10
10
  import { getAttributions } from './gtfs/attributions.js';
11
+ import { getBookingRules } from './gtfs/booking-rules.js';
11
12
  import { getCalendarDates } from './gtfs/calendar-dates.js';
12
13
  import { getCalendars } from './gtfs/calendars.js';
13
14
  import { getFareAttributes } from './gtfs/fare-attributes.js';
@@ -19,6 +20,8 @@ import { getFareTransferRules } from './gtfs/fare-transfer-rules.js';
19
20
  import { getFeedInfo } from './gtfs/feed-info.js';
20
21
  import { getFrequencies } from './gtfs/frequencies.js';
21
22
  import { getLevels } from './gtfs/levels.js';
23
+ import { getLocationGroups } from './gtfs/location-groups.js';
24
+ import { getLocationGroupStops } from './gtfs/location-group-stops.js';
22
25
  import { getNetworks } from './gtfs/networks.js';
23
26
  import { getPathways } from './gtfs/pathways.js';
24
27
  import { getRouteNetworks } from './gtfs/route-networks.js';
@@ -86,6 +89,9 @@ export { _getAreas as getAreas };
86
89
  const _getAttributions = getAttributions;
87
90
  export { _getAttributions as getAttributions };
88
91
 
92
+ const _getBookingRules = getBookingRules;
93
+ export { _getBookingRules as getBookingRules };
94
+
89
95
  const _getCalendarDates = getCalendarDates;
90
96
  export { _getCalendarDates as getCalendarDates };
91
97
 
@@ -119,6 +125,12 @@ export { _getFrequencies as getFrequencies };
119
125
  const _getLevels = getLevels;
120
126
  export { _getLevels as getLevels };
121
127
 
128
+ const _getLocationGroups = getLocationGroups;
129
+ export { _getLocationGroups as getLocationGroups };
130
+
131
+ const _getLocationGroupStops = getLocationGroupStops;
132
+ export { _getLocationGroupStops as getLocationGroupStops };
133
+
122
134
  const _getNetworks = getNetworks;
123
135
  export { _getNetworks as getNetworks };
124
136
 
package/lib/import.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import path from 'node:path';
2
2
  import { createReadStream, existsSync, lstatSync } from 'node:fs';
3
- import { readdir, rename, writeFile } from 'node:fs/promises';
4
- import copy from 'recursive-copy';
3
+ import { cp, readdir, rename, writeFile } from 'node:fs/promises';
5
4
  import fetch from 'node-fetch';
6
5
  import { parse } from 'csv-parse';
7
6
  import pluralize from 'pluralize';
@@ -42,7 +41,7 @@ const downloadFiles = async (task) => {
42
41
  });
43
42
 
44
43
  if (response.status !== 200) {
45
- throw new Error('Couldn’t download files');
44
+ throw new Error(`Unable to download GTFS from ${task.agency_url}`);
46
45
  }
47
46
 
48
47
  const buffer = await response.arrayBuffer();
@@ -51,14 +50,19 @@ const downloadFiles = async (task) => {
51
50
  task.log('Download successful');
52
51
  };
53
52
 
54
- const downloadGtfsRealtimeData = async (url, headers) => {
53
+ const downloadGtfsRealtimeData = async (url, task) => {
55
54
  const response = await fetch(url, {
56
55
  method: 'GET',
57
- headers: { ...{}, ...headers, ...{ 'Accept-Encoding': 'gzip' } },
56
+ headers: {
57
+ ...{},
58
+ ...task.realtime_headers,
59
+ ...{ 'Accept-Encoding': 'gzip' },
60
+ },
58
61
  });
59
62
 
60
63
  if (response.status !== 200) {
61
- throw new Error('Couldn’t download files');
64
+ task.warn(`Unable to download GTFS-Realtime from ${url}`);
65
+ return null;
62
66
  }
63
67
 
64
68
  const buffer = await response.arrayBuffer();
@@ -190,17 +194,14 @@ const updateRealtimeData = async (task) => {
190
194
  for (const realtimeUrl of task.realtime_urls) {
191
195
  task.log(`Downloading GTFS-Realtime from ${realtimeUrl}`);
192
196
  // eslint-disable-next-line no-await-in-loop
193
- const gtfsRealtimeData = await downloadGtfsRealtimeData(
194
- realtimeUrl,
195
- task.realtime_headers,
196
- );
197
-
198
- task.log(`Download successful`);
197
+ const gtfsRealtimeData = await downloadGtfsRealtimeData(realtimeUrl, task);
199
198
 
200
- if (!gtfsRealtimeData.entity) {
199
+ if (!gtfsRealtimeData?.entity) {
201
200
  continue;
202
201
  }
203
202
 
203
+ task.log(`Download successful`);
204
+
204
205
  let totalLineCount = 0;
205
206
 
206
207
  for (const entity of gtfsRealtimeData.entity) {
@@ -353,7 +354,7 @@ const readFiles = async (task) => {
353
354
  } else {
354
355
  // Local file is unzipped, just copy it from there.
355
356
  try {
356
- await copy(gtfsPath, task.downloadDir);
357
+ await cp(gtfsPath, task.downloadDir, { recursive: true });
357
358
  } catch {
358
359
  throw new Error(
359
360
  `Unable to load files from path \`${gtfsPath}\` defined in configuration. Verify that path exists and contains GTFS files.`,
@@ -469,22 +470,29 @@ const formatLine = (line, model, totalLineCount) => {
469
470
  }
470
471
  }
471
472
 
472
- // Convert to midnight timestamp
473
- const timestampColumnNames = [
473
+ // Convert to midnight timestamp and add timestamp columns as integer seconds from midnight
474
+ const timeColumnNames = [
474
475
  'start_time',
475
476
  'end_time',
476
477
  'arrival_time',
477
478
  'departure_time',
479
+ 'prior_notice_last_time',
480
+ 'prior_notice_start_time',
481
+ 'start_pickup_drop_off_window',
478
482
  ];
479
483
 
480
- for (const timestampColumnName of timestampColumnNames) {
481
- if (formattedLine[timestampColumnName]) {
482
- formattedLine[`${timestampColumnName}stamp`] =
483
- calculateSecondsFromMidnight(formattedLine[timestampColumnName]);
484
+ for (const timeColumnName of timeColumnNames) {
485
+ if (formattedLine[timeColumnName]) {
486
+ const timestampColumnName = timeColumnName.endsWith('time')
487
+ ? `${timeColumnName}stamp`
488
+ : `${timeColumnName}_timestamp`;
489
+ formattedLine[timestampColumnName] = calculateSecondsFromMidnight(
490
+ formattedLine[timeColumnName],
491
+ );
484
492
 
485
493
  // Ensure leading zeros for time columns
486
- formattedLine[timestampColumnName] = padLeadingZeros(
487
- formattedLine[timestampColumnName],
494
+ formattedLine[timeColumnName] = padLeadingZeros(
495
+ formattedLine[timeColumnName],
488
496
  );
489
497
  }
490
498
  }
@@ -16,7 +16,7 @@ export function getTimetableNotesReferences(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(timetableNotesReferences.filenameBase);
@@ -26,7 +26,7 @@ export function getTimetableNotesReferences(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getTimetableNotes(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(timetableNotes.filenameBase);
@@ -26,7 +26,7 @@ export function getTimetableNotes(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getTimetablePages(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(timetablePages.filenameBase);
@@ -26,7 +26,7 @@ export function getTimetablePages(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getTimetableStopOrders(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(timetableStopOrder.filenameBase);
@@ -26,7 +26,7 @@ export function getTimetableStopOrders(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getTimetables(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(timetables.filenameBase);
@@ -26,7 +26,7 @@ export function getTimetables(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getTripsDatedVehicleJourneys(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(directions.filenameBase);
@@ -26,7 +26,7 @@ export function getTripsDatedVehicleJourneys(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getDeadheadTimes(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(deadheadTimes.filenameBase);
@@ -26,7 +26,7 @@ export function getDeadheadTimes(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getDeadheads(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(deadheads.filenameBase);
@@ -26,7 +26,7 @@ export function getDeadheads(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getOpsLocations(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(opsLocations.filenameBase);
@@ -26,7 +26,7 @@ export function getOpsLocations(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getRunEvents(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(runEvents.filenameBase);
@@ -26,7 +26,7 @@ export function getRunEvents(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -16,7 +16,7 @@ export function getRunsPieces(
16
16
  query = {},
17
17
  fields = [],
18
18
  orderBy = [],
19
- options = {}
19
+ options = {},
20
20
  ) {
21
21
  const db = options.db ?? openDb();
22
22
  const tableName = sqlString.escapeId(runsPieces.filenameBase);
@@ -26,7 +26,7 @@ export function getRunsPieces(
26
26
 
27
27
  return db
28
28
  .prepare(
29
- `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
30
  )
31
31
  .all();
32
32
  }
@@ -10,13 +10,13 @@ const model = {
10
10
  },
11
11
  {
12
12
  name: 'agency_id',
13
- type: 'varchar(255)',
13
+ type: 'varchar(255)',
14
14
  prefix: true,
15
15
  },
16
16
  {
17
17
  name: 'route_id',
18
18
  type: 'varchar(255)',
19
- prefix: true,
19
+ prefix: true,
20
20
  },
21
21
  {
22
22
  name: 'trip_id',