Skip to content

Heads-up: SchemaBot's core will become database-agnostic (PostgreSQL support planned) #696

Description

@Kiran01bm

What

A heads-up for anyone following or building on SchemaBot: we intend to make the
codebase database-agnostic, so new database families — PostgreSQL first
can be added as implementations rather than rewrites.

We're posting this for transparency: this is a direction we've decided on,
not an open question. There's no near-term behavior change, and existing
MySQL/Vitess deployments are unaffected — the point is to set expectations now.

Two independent dimensions

The MySQL coupling has two dimensions that are often conflated. They're tracked
together but ship separately:

  • Target databases (the databases SchemaBot runs schema changes against).
    This is the user-visible goal. The engine layer is already pluggable (Spirit
    for MySQL, PlanetScale for Vitess, and a Postgres engine stub already exists);
    the remaining work is DDL parsing, dialect assumptions, and the Postgres
    online-DDL mechanism.
  • SchemaBot's own state store (plans, applies, tasks, checks, leases, etc.).
    This lives behind a clean storage interface today with a single MySQL
    implementation. Making it dialect-agnostic is independent of target support
    and can trail it.

Guiding principles

  • Second implementation before abstraction polish — the interfaces already
    exist; we won't redesign them until a real Postgres implementation exposes
    pressure points.
  • Capability gates, not lowest-common-denominator — MySQL-only features stay
    available for MySQL and are gated by engine capability interfaces, not removed.
  • No behavior change for existing MySQL/Vitess deployments at any merge
    point — every step is dormant or dialect-routed.

The hard part

The Postgres online-DDL mechanism is the long pole — it shapes the engine's
cutover/revert state machine and needs its own mini-design before implementation.
Advisory-lock semantics also differ enough from MySQL's named locks to warrant a
deliberate design rather than a direct translation.

Scope

  • PostgreSQL is the first new target; the architecture is meant to generalize
    beyond it.
  • MySQL and Vitess remain first-class, fully supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions