You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(connectors): implement Phase 5.2 PostgreSQL and Supabase adapter - #44
This pull request implements Phase 5.2 of the DERA project: the production-oriented, read-only PostgreSQL and Supabase PostgreSQL connector adapter conforming to the Phase 5.1 DatabaseConnector interface, capability model, and error taxonomy.
Documentation in docs/ updated or verified where required
Documentation validation passed (npm run docs:check)
No documentation updates required for this change
Updated docs/audit/PHASE_5_2_POSTGRESQL_BASELINE.md, docs/audit/PHASE_5_2_POSTGRESQL_ACCEPTANCE.md, and 11 comprehensive guides in docs/connectors/postgresql/.
Security Impact & Deterministic Engineering
Strict Non-AI Policy: Verified zero generative AI, LLM, or external inference APIs are introduced.
Database Safety: Verified all database connector operations enforce read-only introspection without data modification.
Credential Protection: Confirmed that no production credentials, passwords, or .env secrets are committed.
Least Privilege: Validated that permissions and access boundaries are minimized.
No Security Impact: Change does not affect database connections, security boundaries, or credentials.
Breaking Changes
No breaking changes.
Breaking change introduced (detailed explanation and migration path below):
Contributor Checklist
My code adheres to the project's coding standards (PEP 8, TypeScript strict mode).
My branch is rebased on the latest main branch.
The PR title follows Conventional Commits (e.g., feat(connectors): add SQLite metadata support).
No unrelated changes or accidental files are included.
This pull request adds a PostgreSQL and Supabase read-only metadata connector. It adds configuration, connection management, catalog inspection, registry wiring, and public metadata types. It also adds connector documentation, automated tests, and a CI step that runs live PostgreSQL integration tests.
Adds sequence and partition metadata models, PostgreSQL and Supabase pooler configuration, catalog queries, and capability declarations. Tests cover configuration and pooler settings. Documentation describes the catalog, configuration, permissions, capabilities, type handling, and the recorded baseline.
Adds catalog result conversion and the PostgresConnector adapter. The adapter delegates metadata requests to catalog inspectors and forwards configured timeouts and cancellation tokens. The package exports PostgreSQL connector types and registers the connector for the PostgreSQL engine.
Live integration and acceptance tests/integration/postgresql/test_postgres_live.py, .github/workflows/ci.yml, docs/audit/PHASE_5_2_POSTGRESQL_ACCEPTANCE.md, docs/audit/README.md, docs/connectors/README.md, docs/connectors/postgresql/TESTING.md, docs/jobs/*
Adds live tests for catalog inspection and read-only enforcement. CI runs the live test file against its PostgreSQL 16 service. The acceptance report records verification results and limitations. Other documentation changes update indexes and code-fence labels or remove trailing heading colons.
sequenceDiagram
participant PostgresConnector
participant PostgresConnectionManager
participant asyncpg
participant CatalogInspector
PostgresConnector->>PostgresConnectionManager: Connect and configure session
PostgresConnectionManager->>asyncpg: Open connection and set read-only mode
PostgresConnector->>CatalogInspector: Request metadata
CatalogInspector->>PostgresConnectionManager: Fetch catalog query
PostgresConnectionManager->>asyncpg: Execute query
Loading
Possibly related PRs
krishanth7/dera#40: Adds the PostgreSQL service and asyncpg foundation used by this connector and its CI integration.
krishanth7/dera#39: Adds the internal PostgreSQL platform foundation that shares the driver dependency and PostgreSQL CI setup with this connector.
Merge Risk: High · up to 583e5
The PostgreSQL/Supabase connector has several defects that would affect real use: wrong pooler ports, prepared-statement failures through the registry, error paths that raise the wrong exception type, and hostnames that are not checked against blocked network targets. The new live CI tests also fail, and the acceptance report wrongly says they pass. Fix these before merging.
Finishing Touches
📝 Generate docstrings
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request implements Phase 5.2 of the DERA project: the production-oriented, read-only PostgreSQL and Supabase PostgreSQL connector adapter conforming to the Phase 5.1
DatabaseConnectorinterface, capability model, and error taxonomy.Change Type
feat)fix)docs)refactor)perf)test)ci,build)security)!)Related Issues
Closes #43
Implementation Details
PostgresConnectoradhering toDatabaseConnectorwithasyncpgasync driver.statement_cache_size=0) connection interfaces.create_postgres_ssl_contextwithdisable,require,verify-ca, andverify-fullmodes.SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;), 30s statement timeouts, unprivileged inspection role policy, and pre-reviewed catalog queries.pg_namespace,pg_class,pg_attribute,pg_constraint,pg_index,pg_views,pg_matviews,pg_sequence, andpg_inherits.Testing
python scripts/development/dev.py allortest)Test evidence & notes:
384 tests executed across repository: 382 passed, 2 skipped offline (executed in CI container against PostgreSQL 16 service). 41 dedicated PostgreSQL connector tests passing:
tests/connectors/postgresql/test_configuration.py: 4 passedtests/connectors/postgresql/test_errors.py: 9 passedtests/connectors/postgresql/test_catalog_queries.py: 9 passedtests/connectors/postgresql/test_postgres_adapter.py: 9 passedtests/connectors/postgresql/test_postgres_security.py: 5 passedtests/connectors/postgresql/test_supabase_compatibility.py: 4 passedDocumentation Impact
docs/updated or verified where requirednpm run docs:check)Updated
docs/audit/PHASE_5_2_POSTGRESQL_BASELINE.md,docs/audit/PHASE_5_2_POSTGRESQL_ACCEPTANCE.md, and 11 comprehensive guides indocs/connectors/postgresql/.Security Impact & Deterministic Engineering
.envsecrets are committed.Breaking Changes
Contributor Checklist
mainbranch.feat(connectors): add SQLite metadata support).