tb datasource

Manages data sources. Global options apply to this command. See Global options.

The following subcommands are available:

SubcommandDescription
analyze URL_OR_FILEAnalyzes a URL or a file before creating a new data source.
append DATASOURCE_NAME URLAppends data to an existing data source from URL, local file or a connector. For example, tb datasource append my_datasource https://my_url.com.
dataPrints data returned by an endpoint.
delete [OPTIONS] DATASOURCE_NAMEDeletes rows from a data source.
export [OPTIONS] DATASOURCE_NAMEExports data from a data source to a local file in CSV or NDJSON format.
ls [OPTIONS]Lists data sources.
replace DATASOURCE_NAME URLReplaces the data in a data source from a URL, local file or a connector.
truncate [OPTIONS] DATASOURCE_NAMETruncates a data source.

tb datasource data

Prints data returned by an endpoint.

OptionDescription
--limit INTEGERLimits the number of rows to return.

tb datasource delete

Deletes a data source. For example, tb datasource delete my_datasource --wait.

OptionDescription
--yesDoes not ask for confirmation.
--waitWaits for delete job to finish.
--dry-runRuns the command without deleting anything.

tb datasource export

Exports data from a data source to a local file in CSV or NDJSON format.

For example:

  • Export all rows as CSV: tb datasource export my_datasource
  • Export 1000 rows as NDJSON: tb datasource export my_datasource --format ndjson --rows 1000
  • Export to specific file: tb datasource export my_datasource --target ./data/export.csv
OptionDescription
--format [csv|ndjson]Output format (CSV or NDJSON)
--rows INTEGERNumber of rows to export (default: 100)
--where TEXTCondition to filter data
--target TEXTTarget file path. Default is datasource_name.{format}
-h, --helpShow this message and exit.

tb datasource ls

Lists data sources.

OptionDescription
--match TEXTRetrieves any resource matching the pattern.
--format [json]Returns the results in the specified format.

tb datasource truncate

Truncates a data source. For example, tb datasource truncate my_datasource.

OptionDescription
--yesDoes not ask for confirmation.
--cascadeTruncates the dependent data source attached in cascade to the given data source.
Updated