CAPYSQUASH

Integrations Overview

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:

  1. Migration Patterns - Recognizes ORM-specific migration formats
  2. Metadata Tables - Identifies tracking tables (_prisma_migrations, __drizzle_migrations)
  3. Schema Patterns - Detects auth provider table structures
  4. File Structure - Recognizes ORM directory conventions

Zero Configuration

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

Read Prisma Guide →

🟢 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

Read Drizzle Guide →

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

Read Clerk Guide →

Coming Soon

  • Auth0 - Auth0 table patterns
  • NextAuth - Session and account schemas
  • Firebase Auth - Firebase integration tables
  • Supabase Auth - See Supabase Platform Guide

Integration Configuration

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

IntegrationCLIPlatformEngine 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$",
    },
})

Learn more about Engine API →

Troubleshooting

Integration Not Detected

# Check detection
capysquash analyze migrations/ --verbose

# Force enable integration
capysquash squash migrations/ \
  --integration prisma:enabled \
  --integration clerk:enabled

Metadata 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-schemas

Next 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?

On this page