| Crates.io | motherduck-supasync |
| lib.rs | motherduck-supasync |
| version | 1.0.5 |
| created_at | 2026-01-05 07:49:42.166357+00 |
| updated_at | 2026-01-05 07:49:42.166357+00 |
| description | A Rust CLI for syncing Supabase PostgreSQL data to MotherDuck for analytics |
| homepage | |
| repository | https://github.com/Foodshareclub/motherduck-supasync |
| max_upload_size | |
| id | 2023359 |
| size | 308,730 |
A Rust CLI for syncing PostgreSQL data to MotherDuck for analytics.
PostgreSQL/Supabase → motherduck-supasync → MotherDuck (DuckDB)
# Install
cargo install --path .
# Set credentials
export DATABASE_URL="postgres://...@pooler.supabase.com:6543/postgres"
export MOTHERDUCK_TOKEN="your_token"
export SYNC_TABLES_JSON='[{"source":"users","target":"users","pk":["id"]}]'
# Sync
motherduck-supasync sync
| Guide | Description |
|---|---|
| Getting Started | Installation and first sync |
| Configuration | Environment variables, JSON, and TOML options |
| CLI Reference | All commands and options |
| Database Setup | PostgreSQL staging tables and MotherDuck setup |
| GitHub Actions | Automated sync workflow |
| Troubleshooting | Common issues and solutions |
cp tables.example.json tables.local.json
[
{
"source": "staging_users",
"target": "full_users",
"pk": ["id"],
"columns": ["id", "email", "created_at"],
"order_by": "created_at"
}
]
motherduck-supasync generate-secret --input tables.local.json
| Secret | Description |
|---|---|
DATABASE_URL |
Supabase pooler connection (port 6543) |
MOTHERDUCK_TOKEN |
MotherDuck access token |
SYNC_TABLES_CONFIG |
Base64-encoded table config |
motherduck-supasync sync # Incremental sync
motherduck-supasync sync --full # Full resync
motherduck-supasync test # Test connectivity
motherduck-supasync status # Show unsynced counts
motherduck-supasync query --counts # Query MotherDuck
motherduck-supasync generate-secret # Generate config secret
| Field | Required | Description |
|---|---|---|
source |
✅ | Source table in PostgreSQL |
target |
✅ | Target table in MotherDuck |
pk |
✅ | Primary key column(s) |
columns |
Columns to sync (default: all) | |
mappings |
Column renames {"old": "new"} |
|
filter |
WHERE clause filter | |
order_by |
ORDER BY column | |
enabled |
Enable/disable (default: true) |
┌──────────────┐ ┌─────────────────┐ ┌─────────────┐
│ PostgreSQL │────▶│ motherduck-supasync │────▶│ MotherDuck │
└──────────────┘ └─────────────────┘ └─────────────┘
│ │
└─────────────────────┘
Mark synced
WHERE synced_to_motherduck = false)Licensed under either of:
at your option.
Contributions welcome! Please read the license terms before contributing.