Databases

Inspect workspace databases, query table records, and import CSV data with the Ploy CLI.

Command overview

Database commands
ploy database list
ploy database tables <databaseId>
ploy database query <databaseId> <tableId>
ploy database import <databaseId> --file <path> --table-name <name>
CommandWhat it does
listLists the databases in the effective workspace.
tablesLists the tables in one database.
queryReturns rows from one table, with optional search and cursor pagination.
importImports a CSV into a new or existing table and types columns automatically.

List databases

List workspace databases
ploy database list

Add --json to print the API response as JSON.

List tables

List tables in a database
ploy database tables <databaseId>

databaseId is required. Add --json to print the API response as JSON.

Query table rows

Query a table
ploy database query <databaseId> <tableId>
ploy database query <databaseId> <tableId> --limit 100
ploy database query <databaseId> <tableId> --search "enterprise"
ploy database query <databaseId> <tableId> --cursor <cursor> --json

The table ID uses the tbl_… format.

OptionMeaning
--limit <n>Maximum rows to return, from 1 to 500.
--search <text>Runs a full-text search across the table.
--cursor <cursor>Continues from the pagination cursor returned by a prior query.
--jsonPrints the full page object—rows, nextCursor, and hasMore—as one JSON line.

Import a CSV

The first CSV row must contain column headers. Columns are typed automatically during import.

Create a new table

Import into a new table
ploy database import <databaseId> --file ./records.csv --table-name Records

Import into an existing table

Import into an existing table
ploy database import <databaseId> --file ./records.csv --table-id tbl_…
OptionMeaning
--file <path>Reads the CSV from a file. Without it, the command reads standard input.
--table-name <name>Creates a new table with this name.
--table-id <tableId>Imports into an existing tbl_… table.
--idempotency-key <key>Deduplicates a retried import so it does not insert the same rows twice.
--jsonPrints the API response as JSON.

Give exactly one of --table-name or --table-id.

To pipe a CSV through standard input:

Import from standard input
cat ./records.csv | ploy database import <databaseId> --table-name Records --idempotency-key records-2026-08-19

Get built-in help

Inspect database command help
ploy database --help
ploy database list --help
ploy database tables --help
ploy database query --help
ploy database import --help

Keep going