block / block/schemabot

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

Open
#696 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
30
Forks
7
Avg merge
1d 7h
Merged PRs (30d)
316

Description

## 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.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the pluggable engine layer, the existing PostgreSQL engine stub, and the storage interface described in the issue. The PostgreSQL online-DDL mechanism and advisory-lock semantics need a mini-design before implementation; done is not defined as a specific code change in this issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, mysql, postgresql
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.