TailorDB Commands
Commands for managing TailorDB tables, data, and schema migrations.
tailordb
Manage TailorDB tables and data.
Usage
tailor-sdk tailordb [command]Commands
| Command | Description |
|---|---|
tailordb truncate | Truncate (delete all records from) TailorDB tables. |
tailordb migration | Manage TailorDB schema migrations. |
tailordb erd | Generate ERD artifacts for TailorDB namespaces using Liam ERD. (beta) |
See Global Options for options available to all commands.
tailordb truncate
Truncate (delete all records from) TailorDB tables.
Usage
tailor-sdk tailordb truncate [options] [types]Arguments
| Argument | Description | Required |
|---|---|---|
types | Type names to truncate | No |
Options
| Option | Alias | Description | Required | Default | Env |
|---|---|---|---|---|---|
--workspace-id <WORKSPACE_ID> | -w | Workspace ID | No | - | TAILOR_PLATFORM_WORKSPACE_ID |
--profile <PROFILE> | -p | Workspace profile | No | - | TAILOR_PLATFORM_PROFILE |
--config <CONFIG> | -c | Path to SDK config file | No | "tailor.config.ts" | TAILOR_PLATFORM_SDK_CONFIG_PATH |
--yes | -y | Skip confirmation prompts | No | false | - |
--all | -a | Truncate all tables in all namespaces | No | false | - |
--namespace <NAMESPACE> | -n | Truncate all tables in specified namespace | No | - | - |
See Global Options for options available to all commands.
Usage Examples:
# Truncate all tables in all namespaces (requires confirmation)
tailor-sdk tailordb truncate --all
# Truncate all tables in all namespaces (skip confirmation)
tailor-sdk tailordb truncate --all --yes
# Truncate all tables in a specific namespace
tailor-sdk tailordb truncate --namespace myNamespace
# Truncate specific types (namespace is auto-detected)
tailor-sdk tailordb truncate User Post Comment
# Truncate specific types with confirmation skipped
tailor-sdk tailordb truncate User Post --yesNotes:
- You must specify exactly one of:
--all,--namespace, or type names - When truncating specific types, the namespace is automatically detected from your config
- Confirmation prompts vary based on the operation:
--all: requires typingtruncate all--namespace: requires typingtruncate <namespace-name>- Specific types: requires typing
yes
- Use
--yesflag to skip confirmation prompts (useful for scripts and CI/CD)
tailordb migration
Manage TailorDB schema migrations.
Note: Migration scripts are automatically executed during tailor-sdk apply. See Automatic Migration Execution for details.
Usage
tailor-sdk tailordb migration [command]Commands
| Command | Description |
|---|---|
tailordb migration generate | Generate migration files by detecting schema differences between current local types and the previous migration snapshot. |
tailordb migration set | Set migration checkpoint to a specific number. |
tailordb migration status | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
See Global Options for options available to all commands.
tailordb migration generate
Generate migration files by detecting schema differences between current local types and the previous migration snapshot.
Usage
tailor-sdk tailordb migration generate [options]Options
| Option | Alias | Description | Required | Default | Env |
|---|---|---|---|---|---|
--yes | -y | Skip confirmation prompts | No | false | - |
--config <CONFIG> | -c | Path to SDK config file | No | "tailor.config.ts" | TAILOR_PLATFORM_SDK_CONFIG_PATH |
--name <NAME> | -n | Optional description for the migration | No | - | - |
--init | - | Delete existing migrations and start fresh | No | false | - |
See Global Options for options available to all commands.
tailordb migration set
Set migration checkpoint to a specific number.
Usage
tailor-sdk tailordb migration set [options] <number>Arguments
| Argument | Description | Required |
|---|---|---|
number | Migration number to set (e.g., 0001 or 1) | Yes |
Options
| Option | Alias | Description | Required | Default | Env |
|---|---|---|---|---|---|
--workspace-id <WORKSPACE_ID> | -w | Workspace ID | No | - | TAILOR_PLATFORM_WORKSPACE_ID |
--profile <PROFILE> | -p | Workspace profile | No | - | TAILOR_PLATFORM_PROFILE |
--config <CONFIG> | -c | Path to SDK config file | No | "tailor.config.ts" | TAILOR_PLATFORM_SDK_CONFIG_PATH |
--yes | -y | Skip confirmation prompts | No | false | - |
--namespace <NAMESPACE> | -n | Target TailorDB namespace (required if multiple namespaces exist) | No | - | - |
See Global Options for options available to all commands.
tailordb migration status
Show the current migration status for TailorDB namespaces, including applied and pending migrations.
Usage
tailor-sdk tailordb migration status [options]Options
| Option | Alias | Description | Required | Default | Env |
|---|---|---|---|---|---|
--workspace-id <WORKSPACE_ID> | -w | Workspace ID | No | - | TAILOR_PLATFORM_WORKSPACE_ID |
--profile <PROFILE> | -p | Workspace profile | No | - | TAILOR_PLATFORM_PROFILE |
--config <CONFIG> | -c | Path to SDK config file | No | "tailor.config.ts" | TAILOR_PLATFORM_SDK_CONFIG_PATH |
--namespace <NAMESPACE> | -n | Target TailorDB namespace (shows all namespaces if not specified) | No | - | - |
See Global Options for options available to all commands.
See also: For migration concepts, configuration, workflow, and troubleshooting, see the TailorDB Migrations guide.
tailordb erd
Generate ERD artifacts for TailorDB namespaces using Liam ERD. (beta)
Usage
tailor-sdk tailordb erd [command]Commands
| Command | Description |
|---|---|
tailordb erd export | Export Liam ERD dist from applied TailorDB schema. |
tailordb erd serve | Generate and serve ERD locally (liam build + serve dist). (beta) |
tailordb erd deploy | Deploy ERD static website for TailorDB namespace(s). |
See Global Options for options available to all commands.
tailordb erd export
Export Liam ERD dist from applied TailorDB schema.
Usage
tailor-sdk tailordb erd export [options]Options
| Option | Alias | Description | Required | Default | Env |
|---|---|---|---|---|---|
--workspace-id <WORKSPACE_ID> | -w | Workspace ID | No | - | TAILOR_PLATFORM_WORKSPACE_ID |
--profile <PROFILE> | -p | Workspace profile | No | - | TAILOR_PLATFORM_PROFILE |
--config <CONFIG> | -c | Path to SDK config file | No | "tailor.config.ts" | TAILOR_PLATFORM_SDK_CONFIG_PATH |
--namespace <NAMESPACE> | -n | TailorDB namespace name (optional if only one namespace is defined in config) | No | - | - |
--output <OUTPUT> | -o | Output directory path for tbls-compatible ERD JSON (writes to <outputDir>/<namespace>/schema.json) | No | ".tailor-sdk/erd" | - |
See Global Options for options available to all commands.
tailordb erd serve
Generate and serve ERD locally (liam build + serve dist). (beta)
Usage
tailor-sdk tailordb erd serve [options]Options
| Option | Alias | Description | Required | Default | Env |
|---|---|---|---|---|---|
--workspace-id <WORKSPACE_ID> | -w | Workspace ID | No | - | TAILOR_PLATFORM_WORKSPACE_ID |
--profile <PROFILE> | -p | Workspace profile | No | - | TAILOR_PLATFORM_PROFILE |
--config <CONFIG> | -c | Path to SDK config file | No | "tailor.config.ts" | TAILOR_PLATFORM_SDK_CONFIG_PATH |
--namespace <NAMESPACE> | -n | TailorDB namespace name (uses first namespace in config if not specified) | No | - | - |
See Global Options for options available to all commands.
tailordb erd deploy
Deploy ERD static website for TailorDB namespace(s).
Usage
tailor-sdk tailordb erd deploy [options]Options
| Option | Alias | Description | Required | Default | Env |
|---|---|---|---|---|---|
--workspace-id <WORKSPACE_ID> | -w | Workspace ID | No | - | TAILOR_PLATFORM_WORKSPACE_ID |
--profile <PROFILE> | -p | Workspace profile | No | - | TAILOR_PLATFORM_PROFILE |
--config <CONFIG> | -c | Path to SDK config file | No | "tailor.config.ts" | TAILOR_PLATFORM_SDK_CONFIG_PATH |
--namespace <NAMESPACE> | -n | TailorDB namespace name (optional - deploys all namespaces with erdSite if omitted) | No | - | - |
See Global Options for options available to all commands.
Usage Examples:
# Deploy ERD for all namespaces with erdSite configured
tailor-sdk tailordb erd deploy
# Deploy ERD for a specific namespace
tailor-sdk tailordb erd deploy --namespace myNamespace
# Deploy ERD with JSON output
tailor-sdk tailordb erd deploy --jsonNotes:
- This command is a beta feature and may introduce breaking changes in future releases
- Requires
erdSiteto be configured intailor.config.tsfor each namespace you want to deploy - Example config:typescript
export default defineConfig({ db: { myNamespace: { // ... table definitions erdSite: "my-erd-site-name", }, }, });