Skip to content

Conversation

@jy-tan
Copy link
Contributor

@jy-tan jy-tan commented Feb 2, 2026

Summary

Changes REPLAY mode behavior to use MockConnection directly without attempting real database connections. This enables true dependency-free replay where no database server is required at all.

Changes

  • psycopg & psycopg2: In REPLAY mode, skip real DB connection attempts entirely and use MockConnection directly
    • Previously: Tried to connect to real DB, fell back to mock on failure
    • Now: Uses mock immediately without any connection attempt
    • Benefit: Faster startup, no DB server required, truly dependency-free replay
  • psycopg2: Fix django_prometheus compatibility by setting a default cursor_factory when None is provided
    • django_prometheus does conn.cursor_factory or Cursor() which fails if cursor_factory is None

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants