Dataset commands
This topic covers dataset commands for the Postman CLI.
Datasets enable you to define reusable data sources and views for use in Postman workflows. You can use dataset commands to create and manage datasets, configure data sources, run SQL queries, and run saved views.
In your CI/CD script, you can use the --iteration-data-dataset, --iteration-data-view, and --dataset options with the postman collection run command to run a collection with a dataset or a saved view. To learn more, see Collection commands.
postman dataset create
Creates a new dataset.
Usage
Path where the dataset file will be created.
Options
The dataset name.
A description for the dataset.
Unique identifier for the dataset. If not provided, a random v4 UUID is generated.
Overwrites an existing dataset file.
Examples
postman dataset source
Dataset source commands enable you to manage the data sources associated with a dataset.
postman dataset source list
Lists the data sources configured for a dataset.
Usage
Path to a dataset file.
Options
Displays results in JSON format.
Examples
postman dataset source add
Adds a data source to a dataset.
Usage
Path to a dataset file.
Options
The data source name.
Unique identifier for the data source. If not provided, a random v4 UUID is generated.
Update the default format for the data source.
Specifies the source type. If not provided, the type is inferred from --file.
Path to a local CSV or JSON file to add as a source. If you specify a file, the data source type is set to local.
References the source file without copying it into the dataset resources directory.
Overwrites an existing file when copying a data source file.
Database host name.
Database port number.
Database user name.
Database password.
Database name.
Database table name.
Slug for the data source.
Examples
postman dataset source update
Updates an existing data source. Only the options you provide are updated.
Usage
Path to a dataset file.
The data source name or unique identifier.
Options
The postman dataset source update command supports the same options as postman dataset source add for updating the data source configuration. You can use this command to modify connection details for a database source or change the file path for a file-based source.
Examples
postman dataset source remove
Removes a data source from a dataset.
Usage
Path to a dataset file.
The data source name or unique identifier.
Options
Deletes the local file.
Examples
postman dataset list
Lists datasets in a directory or displays summary information for a single dataset.
Usage
A path to a dataset file or a directory with one or more dataset files.
Options
Displays results in JSON format.
Examples
postman dataset get
Displays metadata for a dataset.
Usage
Path to a dataset file.
Options
Displays results in JSON format.
Examples
postman dataset query
Runs a SQL query against a dataset.
Usage
Path to a dataset file.
Options
The SQL query to run.
Positional parameters for queries. You can specify multiple parameters by repeating this option. For example: -p value1 -p value2.
Displays query results in JSON format.
Examples
postman dataset view
Dataset view commands enable you to create, manage, and run saved SQL queries. To learn more, see Example dataset views in Postman.
postman dataset view list
Lists saved views in a dataset.
Usage
Path to a dataset file.
Options
Displays results in JSON format.
Examples
postman dataset view create
Saves a view to a dataset.
Usage
Path to a dataset file.
Options
The view name.
The SQL query.
Unique identifier for the view. If not provided, a random v4 UUID is generated.
Examples
postman dataset view update
Updates a saved view.
Usage
Path to a dataset file.
The view name or unique identifier.
Options
The view name.
The SQL query.
Examples
postman dataset view delete
Deletes a saved view from a dataset.
Usage
Path to a dataset file.
The view name or unique identifier.
Examples
postman dataset view run
Runs a saved view against a dataset and displays the rows.
Usage
Path to a dataset file.
The view name or unique identifier.
Options
Positional parameters for queries. You can specify multiple parameters by repeating this option. For example: -p value1 -p value2.
Displays query results in JSON format.
Examples
postman dataset delete
Deletes a dataset.
Usage
Path to a dataset file.
Options
Skips the confirmation prompt.
Deletes the dataset file but preserves the associated resources directory.