---
CAPYSQUASH documentation page.
---
Title: Integrations Overview. Description: Integrate CAPYSQUASH with ORMs, auth providers, and development tools.
Integrations
CAPYSQUASH integrates with popular ORMs, auth providers, and development tools to optimize your entire database workflow.
ORM Integrations
Auth Integrations
How Integrations Work
AUTOMATIC DETECTION
CAPYSQUASH automatically detects integrations by analyzing:
-
Migration Patterns - Recognizes ORM-specific migration formats
-
Metadata Tables - Identifies tracking tables (_prisma_migrations, __drizzle_migrations)
-
Schema Patterns - Detects auth provider table structures
-
File Structure - Recognizes ORM directory conventions
All integrations work automatically. CAPYSQUASH detects and preserves integration-specific patterns without any setup.
ORM Support
🔷 Prisma
What CAPYSQUASH Preserves:
_prisma_migrations metadata table
Migration checksums and timestamps
Schema comments and annotations
Prisma-specific SQL patterns
Optimization Benefits:
Faster prisma migrate deploy
Smaller migration history
Cleaner schema introspection
Better Git diffs
🟢 Drizzle
What CAPYSQUASH Preserves:
__drizzle_migrations tracking table
Migration order and dependencies
Drizzle Kit conventions
Custom naming patterns
Optimization Benefits:
Faster drizzle-kit push
Cleaner migration history
Improved CI/CD performance
Better debugging
Auth Provider Support
🟣 Clerk
What CAPYSQUASH Preserves:
Clerk user tables and schemas JWT v2 table structures Organization and metadata tables Custom attribute columns
Optimization Benefits:
Maintains auth integrity Preserves user data structure Keeps JWT compatibility Safe consolidation
Coming Soon
Auth0 - Auth0 table patterns NextAuth - Session and account schemas Firebase Auth - Firebase integration tables Supabase Auth - See Supabase Platform Guide
Integration Configuration
Automatic (Recommended)
CAPYSQUASH detects integrations automatically:
capysquash analyze migrations/
# ✓ Detected: Prisma
# ✓ Detected: Clerk
# ✓ Detected: Supabase
Manual Configuration
Force-enable specific integrations:
{
"integrations": {
"prisma": {
"enabled": true,
"metadata_table": "_prisma_migrations",
"preserve_checksums": true
},
"drizzle": {
"enabled": true,
"metadata_table": "__drizzle_migrations"
},
"clerk": {
"enabled": true,
"preserve_jwt_tables": true
}
}
}Integration Compatibility
| Integration | CLI | Platform | Engine API |
|---|---|---|---|
| Prisma | ✅ Full | ✅ Full | ✅ Full |
| Drizzle | ✅ Full | ✅ Full | ✅ Full |
| Clerk | ✅ Full | ✅ Full | ✅ Full |
| Supabase Auth | ✅ Full | ✅ Full | ✅ Full |
| Auth0 | 🚧 Coming | 🚧 Coming | 🚧 Coming |
| NextAuth | 🚧 Coming | 🚧 Coming | 🚧 Coming |
Best Practices
✅ RECOMMENDATIONS
Let auto-detection work - Don't manually configure unless needed
Test thoroughly - Validate auth still works after optimization
Preserve metadata - Never manually delete ORM tracking tables
Review changes - Check that integration patterns are maintained
Use validation - Run capysquash validate to ensure compatibility
Custom Integrations
Building your own integration? Use the Engine API:
import "github.com/CAPYSQUASH/pgsquash-engine/pkg/integrations"
// Register custom integration
integrations.Register("myorm", &integrations.Integration{
Name: "MyORM",
DetectFunc: detectMyORM,
PreservePatterns: []string{
"^_myorm_.*",
"^myorm_metadata$",
},
})Troubleshooting
Integration Not Detected
# Check detection
capysquash analyze migrations/ --verbose
# Force enable integration
capysquash squash migrations/ \
--integration prisma:enabled \
--integration clerk:enabledMetadata Table Missing
If your ORM's metadata table is missing after optimization:
This shouldn't happen - CAPYSQUASH always preserves metadata tables. If you see this, please report it.
Auth Patterns Changed
If auth patterns aren't preserved:
# Use conservative mode
capysquash squash migrations/ \
--safety conservative \
--preserve-auth-schemasNext Steps
Request an Integration
Don't see your ORM or auth provider? Request it on GitHub
We're actively expanding integration support based on community needs.
How is this guide?