Skip to content

Adapters overview

branchly grows by adapters. Each one is a small, self-contained package implementing exactly one axis, and any migrator works with any datasource — that’s the whole point of the four-axis model.

AxisAdapterPackageNotes
DatasourcePostgreSQL@branchly/datasource-postgresInstant clone via CREATE DATABASE … TEMPLATE
DatasourceMySQL@branchly/datasource-mysqlSQL-level cloning, FK- and view-aware
DatasourceSQLite@branchly/datasource-sqliteFile per branch; clone = file copy
MigratorPrisma@branchly/migrator-prismaprisma migrate deploy
MigratorDrizzle@branchly/migrator-drizzledrizzle-kit migrate
MigratorKnex@branchly/migrator-knexknex migrate:latest
Resolverenv file@branchly/resolver-env-fileUpserts the key into .env
Resolverdirenv@branchly/resolver-direnvUpserts an export line into .envrc
VCSGit@branchly/vcs-gitThe default and (so far) only VCS adapter

branchly init detects which of these your project needs and installs them for you.

Short aliases resolve by convention — use: 'postgres' means @branchly/datasource-postgres:

export default defineConfig({
vcs: 'git',
migrator: { use: 'prisma' },
datasource: { use: 'postgres', url: env('DATABASE_URL'), prefix: 'app' },
resolver: { use: 'env-file', file: '.env', key: 'DATABASE_URL' },
});

Anything containing @ or / is treated as a fully-qualified package name, so third-party adapters drop straight in:

export default defineConfig({
migrator: { use: '@yourorg/branchly-migrator-flyway' },
});

All other keys in the block are handed to the adapter as options — each adapter page documents its own.

Adapters are deliberately small (the SQLite datasource is well under a hundred lines), and the conformance test kit tells you when yours is correct. The authoring guide walks through it — contributions are very welcome!