stl_gtfs_query
Execute read-only SQL queries on GTFS transit data to retrieve schedules, routes, and stops. Returns results with enforced limits.
Instructions
Run one read-only SQL query against the imported GTFS feed.
Tables are the GTFS filenames without .txt: agency, stops, routes, trips, stop_times, calendar, calendar_dates, shapes, feed_info. All columns are TEXT, including numeric-looking ids -- leading zeros are meaningful in GTFS.
Writes, ATTACH and PRAGMA are denied at the database driver; a wall-clock timeout and row/byte caps are enforced. Only a single statement is accepted.
This is the general-purpose escape hatch: anything the named tools do not cover can be expressed here.
Args: sql: a single SELECT or WITH statement. limit: max rows (hard cap 1000).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| limit | No | ||
| snapshot | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |