Skip to content

Conversation

@aaijazi
Copy link

@aaijazi aaijazi commented Oct 15, 2025

Summary

Add support for pg_stat_statements extension filter in drizzle-kit to automatically exclude pg_stat_* tables from introspect and push operations.

Changes

  • Extended extensionsFilters type to accept 'pg_stat_statements'
  • Updated getTablesFilterByExtensions() to filter !pg_stat_* tables
  • Updated Zod validation schemas to accept the new extension type
  • Refactored extension filter logic to support multiple extensions simultaneously
  • Added comprehensive unit tests covering all scenarios
  • Added TSDoc documentation for the feature

Usage Example

import { defineConfig } from 'drizzle-kit'

export default defineConfig({
  dialect: "postgresql",
  extensionsFilters: ["postgis", "pg_stat_statements"],
})

Testing

Created new test file drizzle-kit/tests/extensions.test.ts with tests for:

  • Individual extension filters (postgis, pg_stat_statements)
  • Multiple extensions combined
  • No extension filters
  • PostgreSQL-only dialect behavior

⚠️ Note: This commit is not GPG signed yet. Will need to be signed before merging per CONTRIBUTING.md guidelines.

🤖 Generated with Claude Code

Extended extensionsFilters to support pg_stat_statements extension,
which automatically filters out all pg_stat_* tables from introspect
and push operations. This is useful when working with PostgreSQL
databases that have the pg_stat_statements extension enabled.

Changes:
- Updated getTablesFilterByExtensions() to filter !pg_stat_* tables
- Extended extensionsFilters type to include 'pg_stat_statements'
- Updated Zod validation schemas
- Added comprehensive unit tests
- Added TSDoc documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant