View
foundry view displays the contents of a database table directly in the terminal, rendered as a formatted table with optional paging. It is useful for quickly inspecting data without opening a database client.
foundry view [options]
Options
| Option | Short | Description |
|---|---|---|
--datasource <FILE> |
-d |
Datasource JSON file |
--conn <STRING> |
-c |
ADO.NET connection string |
--db <TYPE> |
-b |
Database engine type |
--schema <NAME> |
-s |
Name of the schema containing the table (required) |
--table <NAME> |
-t |
Name of the table to view (required) |
--columns <COLUMNS> |
-C |
Comma-separated list of columns to display (default: all) |
--limit <N> |
-l |
Maximum number of rows to fetch |
--page-size <N> |
-p |
Rows per page — prompts between pages |
--stream |
-S |
Stream results via a cursor instead of buffering |
--log-config <FILE> |
-L |
Log configuration file |
--verbose |
-v |
Print SQL as it executes |
Examples
# View all rows in a table
foundry view --datasource connection.json --schema dbo --table customers
# View specific columns with paging
foundry view \
--datasource PostgreSQL_17.6.json \
--schema public --table orders \
--columns "id,customer_id,total,created_at" \
--stream --page-size 25
# Limit results and filter columns
foundry view \
--datasource connection.json \
--schema dbo --table products \
--columns "id,name,price" \
--limit 100
# Inline connection string
foundry view \
--conn "Server=localhost;Database=mydb;User Id=sa;Password=pass" \
--db SQLServer \
--schema dbo --table audit_log \
--page-size 50
Buffered vs Streaming Mode
By default, foundry view fetches the full result set into memory before rendering. This gives accurate row counts and total page counts, but can be slow for large tables.
Use --stream to read results row-by-row via a database cursor. Streaming starts rendering immediately and uses much less memory, but the total row count is not known in advance — pages show the current row range without a total.
| Mode | --stream |
When to use |
|---|---|---|
| Buffered | No | Small to medium tables; accurate page counts needed |
| Streaming | Yes | Large tables; fast first output; memory-constrained environments |
Paging
When --page-size is specified, results are displayed one page at a time. After each page, Foundry pauses and waits for a keypress:
- Enter — advance to the next page
- Q — quit and return to the shell
Without --page-size, all rows are rendered in a single pass. For large tables this can produce very long output — combine with --limit or --stream --page-size to keep output manageable.
Column Selection
--columns accepts a comma-separated list of column names in the order they should appear. Column names are case-insensitive:
foundry view --datasource connection.json --schema dbo --table orders \
--columns "order_id,customer_id,total,status,created_at"
NULL values are displayed as NULL in grey. Binary (blob) columns are displayed as [blob].