Skip to content

Generalize external database modules - #175

Merged
Areson merged 2 commits into
Areson/postgres-config-guardsfrom
Areson/database-module-extensibility
Aug 7, 2026
Merged

Generalize external database modules#175
Areson merged 2 commits into
Areson/postgres-config-guardsfrom
Areson/database-module-extensibility

Conversation

@Areson

@Areson Areson commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Why

Keep Blip purpose-built for MySQL while allowing pgblip and future database modules to reuse its monitor, plan, transform, and sink runtime without adding engine implementations to core.

What

  • Replace PostgreSQL-specific core configuration with an opaque registered database-module contract
  • Generalize collector compatibility, factory delegation, and credential port handling
  • Preserve MySQL defaults while adding strict module validation, redaction, and type-preserving config interpolation

Risk Assessment

Low — the change targets an unreleased feature stack, leaves omitted database types on historical MySQL behavior, and passed full local unit, race, vet, and build validation.

Stack

  1. Support external database modules #176 ioberst/bgblip-modulemain
  2. Add PostgreSQL multi-database monitoring #177 ioberst/multi-database-monitorioberst/bgblip-module
  3. Harden PostgreSQL monitor lifecycle #174 Areson/postgres-config-guardsioberst/multi-database-monitor
  4. This PR: Generalize external database modules #175 Areson/database-module-extensibilityAreson/postgres-config-guards

Review bottom-to-top; merge in reverse order: #175, #174, #177, then #176. Keep the stack in draft until the manual Blippy PostgreSQL staging canary passes.

Generated with Codex

Areson and others added 2 commits August 7, 2026 07:19
Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true
Preserve named and typed containers when Blip expands environment and monitor placeholders in opaque module configuration. This keeps programmatic config loaders consistent with YAML-loaded config.

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true
@daniel-nichter

Copy link
Copy Markdown
Contributor

🤔

Side note: making Blip work for pg crossed my mind at the beginning, but back then the chance of SQ needing it for pg was negligible (even considering AP), so the YAGNI argument won. Funny how things change.

@Areson

Areson commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

Well...this was pushed a litter sooner than I expected.

But yes, I'm working on it. I was torn about extending the "purpose build MySQL" tool to pg, so I'm currently taking the route of trying to generalize bits of the core around auth, etc. (which is pretty engine-agnostic) and allow extending it via external plugins. The end goal being that core blip stays focused on MySQL, but can load external DB engine modules to handle other flavors.

@Areson
Areson marked this pull request as ready for review August 7, 2026 16:39
@Areson
Areson merged commit 305591f into Areson/postgres-config-guards Aug 7, 2026
3 checks passed
@Areson
Areson deleted the Areson/database-module-extensibility branch August 7, 2026 16:40
Areson added a commit that referenced this pull request Aug 7, 2026
* Guard PostgreSQL monitor configuration

Keep MySQL-only heartbeat and plan defaults off PostgreSQL monitors, reject explicit unsupported settings, and sign IAM tokens with the database-specific default port.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Close PostgreSQL integration gaps

Cancel and join plan preparation before closing monitor-owned database resources, and reject the remaining MySQL-only plan configurations for PostgreSQL.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Require PostgreSQL exporter plans

Avoid assigning the MySQL default exporter plan to PostgreSQL monitors. Require a named plan whenever exporter mode is enabled for PostgreSQL while preserving the public and MySQL defaulting behavior.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Coordinate monitor subsystem teardown

Roll back partial startup failures, bind subsystem stops to their startup generation, and retain exporter engines for cleanup before database providers close. Collector cleanup now also runs when a prepared collector is idle.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Join collectors before provider shutdown

Track every engine collector goroutine, cancel active runs during teardown, and wait for foreground or ErrMore background work before invoking cleanup and releasing the database provider.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Generalize external database modules (#175)

* Generalize external database modules

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true

* Interpolate typed database config values

Preserve named and typed containers when Blip expands environment and monitor placeholders in opaque module configuration. This keeps programmatic config loaders consistent with YAML-loaded config.

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true

---------

Co-authored-by: Codex <noreply@openai.com>

---------

Co-authored-by: Codex <noreply@openai.com>
Areson added a commit that referenced this pull request Aug 7, 2026
* Configure PostgreSQL database discovery

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true
Co-authored-by: Goose <opensource@block.xyz>

* Add monitor-owned database providers

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true

* Keep provider constructors internal

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true

* Harden PostgreSQL monitor lifecycle (#174)

* Guard PostgreSQL monitor configuration

Keep MySQL-only heartbeat and plan defaults off PostgreSQL monitors, reject explicit unsupported settings, and sign IAM tokens with the database-specific default port.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Close PostgreSQL integration gaps

Cancel and join plan preparation before closing monitor-owned database resources, and reject the remaining MySQL-only plan configurations for PostgreSQL.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Require PostgreSQL exporter plans

Avoid assigning the MySQL default exporter plan to PostgreSQL monitors. Require a named plan whenever exporter mode is enabled for PostgreSQL while preserving the public and MySQL defaulting behavior.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Coordinate monitor subsystem teardown

Roll back partial startup failures, bind subsystem stops to their startup generation, and retain exporter engines for cleanup before database providers close. Collector cleanup now also runs when a prepared collector is idle.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Join collectors before provider shutdown

Track every engine collector goroutine, cancel active runs during teardown, and wait for foreground or ErrMore background work before invoking cleanup and releasing the database provider.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Generalize external database modules (#175)

* Generalize external database modules

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true

* Interpolate typed database config values

Preserve named and typed containers when Blip expands environment and monitor placeholders in opaque module configuration. This keeps programmatic config loaders consistent with YAML-loaded config.

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true

---------

Co-authored-by: Codex <noreply@openai.com>

---------

Co-authored-by: Codex <noreply@openai.com>

---------

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Goose <opensource@block.xyz>
Areson added a commit that referenced this pull request Aug 7, 2026
* Configure PostgreSQL database discovery

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true
Co-authored-by: Goose <opensource@block.xyz>

* Add monitor-owned database providers

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true

* Keep provider constructors internal

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true

* Harden PostgreSQL monitor lifecycle (#174)

* Guard PostgreSQL monitor configuration

Keep MySQL-only heartbeat and plan defaults off PostgreSQL monitors, reject explicit unsupported settings, and sign IAM tokens with the database-specific default port.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Close PostgreSQL integration gaps

Cancel and join plan preparation before closing monitor-owned database resources, and reject the remaining MySQL-only plan configurations for PostgreSQL.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Require PostgreSQL exporter plans

Avoid assigning the MySQL default exporter plan to PostgreSQL monitors. Require a named plan whenever exporter mode is enabled for PostgreSQL while preserving the public and MySQL defaulting behavior.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Coordinate monitor subsystem teardown

Roll back partial startup failures, bind subsystem stops to their startup generation, and retain exporter engines for cleanup before database providers close. Collector cleanup now also runs when a prepared collector is idle.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Join collectors before provider shutdown

Track every engine collector goroutine, cancel active runs during teardown, and wait for foreground or ErrMore background work before invoking cleanup and releasing the database provider.

Co-authored-by: Codex <noreply@openai.com>

Ai-assisted: true

* Generalize external database modules (#175)

* Generalize external database modules

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true

* Interpolate typed database config values

Preserve named and typed containers when Blip expands environment and monitor placeholders in opaque module configuration. This keeps programmatic config loaders consistent with YAML-loaded config.

Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true

---------

Co-authored-by: Codex <noreply@openai.com>

---------

Co-authored-by: Codex <noreply@openai.com>

---------

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Goose <opensource@block.xyz>
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.

2 participants