Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tailor-platform/sdk/llms.txt

Use this file to discover all available pages before exploring further.

The tailordb truncate command deletes all records from one or more TailorDB tables. This is useful for clearing test data, resetting development environments, or preparing tables for fresh data imports.
Truncating tables permanently deletes all data. This operation cannot be undone.

Usage

tailor-sdk tailordb truncate [options] [types]

Arguments

types
string[]
Type names to truncate (e.g., User Post Comment). The namespace is automatically detected from your config.

Options

--workspace-id
string
default:"-w"
Workspace ID for the operation
--profile
string
default:"-p"
Workspace profile to use
--config
string
default:"tailor.config.ts"
Path to SDK config file
--yes
boolean
default:"false"
Skip confirmation prompts (useful for scripts and CI/CD)
--all
boolean
default:"false"
Truncate all tables in all namespaces
--namespace
string
default:"-n"
Truncate all tables in the specified namespace

Truncation Modes

You must specify exactly one of the following:

Truncate All Tables

Truncate all tables in all namespaces defined in your config:
tailor-sdk tailordb truncate --all
This requires typing truncate all to confirm (unless --yes is used).

Truncate by Namespace

Truncate all tables in a specific namespace:
tailor-sdk tailordb truncate --namespace myNamespace
This requires typing truncate <namespace-name> to confirm (unless --yes is used).

Truncate Specific Types

Truncate one or more specific types:
tailor-sdk tailordb truncate User Post Comment
The namespace is automatically detected from your configuration. Requires typing yes to confirm (unless --yes is used).

Examples

Truncate all tables with confirmation

tailor-sdk tailordb truncate --all

Truncate all tables (skip confirmation)

tailor-sdk tailordb truncate --all --yes

Truncate namespace with confirmation

tailor-sdk tailordb truncate --namespace tailordb

Truncate specific types

tailor-sdk tailordb truncate User Post Comment

Truncate specific types (skip confirmation)

tailor-sdk tailordb truncate User Post --yes

Use with custom config file

tailor-sdk tailordb truncate --all --config ./custom.config.ts

Confirmation Behavior

The confirmation prompt varies based on the operation:
  • --all: Requires typing truncate all to confirm
  • --namespace: Requires typing truncate <namespace-name> to confirm
  • Specific types: Requires typing yes to confirm
Use the --yes flag to skip all confirmation prompts.

Implementation Details

The truncate command:
  1. Validates that exactly one truncation mode is specified
  2. Loads the TailorDB configuration from your config file
  3. For specific types, automatically detects which namespace contains each type
  4. Displays a confirmation prompt (unless --yes is used)
  5. Calls the TailorDB API to delete all records from the specified tables
Truncating a table only removes data - the table schema and structure remain intact.

See Also

Build docs developers (and LLMs) love