Skip to main content

Module shard

Module shard 

Source
Expand description

Shard command for extracting tenant-specific data from SQL dumps.

The shard command extracts data belonging to a specific tenant by:

  • Identifying tables with the tenant column (tenant roots)
  • Following FK chains to include dependent data
  • Including junction/pivot tables where any FK matches tenant data
  • Optionally including global/lookup tables

Supports MySQL, PostgreSQL, and SQLite dialects.

Structs§

DefaultShardClassifier
Default patterns for table classification when no config file provided
ShardConfig
Configuration for the shard command
ShardStats
Statistics from shard operation
ShardYamlConfig
Complete YAML configuration for shard command
TableShardStats
Per-table sharding statistics

Enums§

GlobalTableMode
How to handle global/lookup tables during sharding
ShardTableClassification
Table classification for sharding behavior

Functions§

run
Run the shard command