# Faucet v0.1.6: Schema Contract Locking

> Faucet v0.1.6 adds schema contract locking: snapshot your API contract, detect schema drift, and promote database changes on your terms.

Source: https://faucetdb.ai/blog/faucet-v016-release/

Faucet Team · February 26, 2026 · Updated October 8, 2026 · 5 min read

Faucet v0.1.6 introduces schema contract locking, a system that prevents database schema changes from silently breaking your auto-generated REST API. Lock your API contract, detect drift, and promote changes on your terms.

Tags: release, announcement, v0.1.6, schema-locking

Faucet v0.1.6 is now available. The headline feature: **schema contract locking** — a system that prevents database schema changes from silently breaking your API consumers. Download it now from [GitHub Releases](https://github.com/faucetdb/faucet/releases/tag/v0.1.6), [Homebrew](https://github.com/faucetdb/homebrew-tap), or [Docker Hub](https://hub.docker.com/r/faucetdb/faucet).

## The Problem

Auto-generated APIs have a well-known Achilles’ heel: **the schema IS the API contract**. When someone runs `ALTER TABLE` — renames a column, changes a type, drops a constraint — every downstream consumer silently breaks. No deprecation notice. No versioning. No heads-up. They find out in production.

This isn’t theoretical. We’ve seen it happen repeatedly at scale with DreamFactory deployments, and the community has been vocal about it. One [recent Reddit thread](https://www.reddit.com/r/programming/) captured it perfectly:

> _“Any schema change silently becomes an API breaking change. Add a column? Fine. Rename one, change a type, drop a nullable constraint? Every downstream consumer just broke, and nobody got a heads up.”_

Faucet v0.1.6 solves this.

## Schema Contract Locking

When Faucet connects to your database, it now takes a **contract snapshot** — a frozen representation of the schema that your API serves. Schema changes in the database no longer automatically ripple through to the API. You control when and how the API contract evolves.

### Three Lock Modes

Set the mode per database service with the **Schema Lock** setting in the admin UI (or the admin API), then snapshot the contract from the CLI:

```bash
faucet db lock mydb                 # snapshot every table as the contract
faucet db lock mydb --table users   # or just one table
```

| Mode | Behavior | When to use |
| --- | --- | --- |
| `none` | Live schema = live API. Classic behavior. **(default)** | Development, prototyping |
| `auto` | Additive changes auto-promote. Breaking changes blocked. | **Production (recommended)** |
| `strict` | All changes require explicit promotion. | Regulated environments |

### How Auto Mode Works

1. **Lock** — Faucet introspects the schema and saves a contract snapshot. The API serves this shape. You notice nothing — it’s instant and transparent.
2. **Schema drifts** — On the next introspection cycle, Faucet compares the live schema against the contract.
3. **Additive changes** (new column, new table) — Auto-promoted into the contract. New fields appear in API responses. Existing consumers are unaffected — they ignore unknown fields.
4. **Breaking changes** (rename, type change, drop, constraint tightening) — **Blocked.** The API continues serving the locked contract. Faucet flags the drift in the admin UI and CLI.
5. **You promote explicitly** — When you’re ready, run `faucet db promote` or click the button in the UI. The contract updates to reflect the current schema.

### Drift Detection in the Admin UI

The Schema Explorer now shows real-time drift status:

- **Green** — Schema matches the locked contract. No action needed.
- **Yellow** — Additive changes detected and auto-promoted.
- **Red** — Breaking changes detected and blocked. Review and promote when ready.

The drift detail panel shows exactly what changed — column renames, type changes, dropped fields — so you know what will break before you promote.

### CLI Commands

```bash
# Lock the current schema as the API contract
faucet db lock mydb

# Check for drift between live schema and locked contract
faucet db diff mydb

# Promote: update the contract to match the current schema
faucet db promote mydb

# Remove the lock entirely
faucet db unlock mydb
```

The `faucet db diff` output classifies every change as **additive** or **breaking**, so you can pipe it into CI or review it before promoting.

### OpenAPI Spec Stability

When schema locking is active, the generated OpenAPI spec reflects the **locked contract**, not the live schema. This means your spec won’t shift underneath tools, SDKs, and code generators that depend on it. Breaking changes show up when you promote — not when someone runs a migration.

## Why This Matters

The typical advice for this problem is “add OpenAPI diffing to your CI pipeline.” That’s useful but incomplete — it assumes schema changes flow through PRs. In reality, someone runs `ALTER TABLE` directly in production, or a migration runs during a deploy, and downstream services discover the breakage at runtime.

Schema contract locking catches **both** cases. It works whether your schema changes come through CI or through a DBA’s terminal. The API contract holds until you explicitly say otherwise.

## Also in This Release

- **CONTRIBUTING.md** — Faucet is open for contributions. The guide covers development setup, testing, PR expectations, and the project’s coding standards.
- **README improvements** — Updated documentation and Docker links for better discoverability.

## Install or Upgrade

**Homebrew:**

```bash
brew update && brew upgrade faucet
```

**Docker:**

```bash
docker pull faucetdb/faucet:0.1.6
```

**Go install:**

```bash
go install github.com/faucetdb/faucet/cmd/faucet@v0.1.6
```

**Binary download:**

Grab the binary for your platform from [GitHub Releases](https://github.com/faucetdb/faucet/releases/tag/v0.1.6). Available for Linux (amd64, arm64), macOS (Apple Silicon, Intel), and Windows.

## What’s Next

Schema contract locking is the foundation for a broader API lifecycle story. Coming in future releases:

- **Schema diff in CI** — today you can already run `faucet db diff mydb --json` in your pipeline; richer breaking-change reports are on the roadmap
- **Webhook notifications** — get alerted on drift events via webhook
- **Migration-aware promotion** — tie promotions to your migration tool so contracts advance with your deploy

Star the project on [GitHub](https://github.com/faucetdb/faucet) to follow along, and [open an issue](https://github.com/faucetdb/faucet/issues) if you run into anything.

## FAQ

### How do I upgrade from v0.1.5?

Run `brew upgrade faucet` or `docker pull faucetdb/faucet:0.1.6`. Binary users can download the new release from GitHub. Faucet will automatically run the necessary config database migrations on first startup.

### Does locking change anything for existing installations?

No. Services default to `none` (live schema = live API), so nothing changes until you opt in with the Schema Lock setting in the admin UI and snapshot the contract with `faucet db lock mydb`.

### What databases support schema locking?

All of them. Schema contract locking works across PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, and Snowflake.

### Can I lock some tables but not others?

Yes. Pass `--table` to lock, diff, promote, or unlock a single table, for example `faucet db lock mydb --table users`.

### Does this add performance overhead?

Negligible. The contract snapshot is stored in Faucet’s SQLite config database and compared during periodic introspection cycles, not on every API request. The API serving path is unchanged.

Turn on the data.

## Try Faucet in 60 seconds

```
brew install faucetdb/tap/faucet   # or: npx @faucetdb/faucet serve, then use the admin UI
faucet db add --name mydb --driver postgres --host localhost --user app --password-prompt --database mydb
faucet role create --name reader --verbs GET
faucet key create --role reader
faucet serve   # admin UI, REST API and MCP at http://localhost:8080
```

[Star on GitHub](https://github.com/faucetdb/faucet) [Quick start docs](https://wiki.faucetdb.ai/getting-started) [Connect Claude, ChatGPT, Cursor](https://faucetdb.ai/#mcp)

Faucet is free and open source (MIT). Works with PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite and Snowflake.

## Keep reading

[Faucet v0.1.7: Oracle Database Support — 7 Databases, One Binary](https://faucetdb.ai/blog/faucet-v017-release/) (Mar 2, 2026): Faucet v0.1.7 adds full Oracle Database support (12c through 26ai) using a pure-Go driver. No Oracle Instant Client required. Connect Oracle alongside PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, and Snowflake with a single Faucet binary.

[Faucet v0.1.5 Released: First-Run Setup, Batch Transactions, and Background Mode](https://faucetdb.ai/blog/faucet-v015-release/) (Feb 24, 2026): Faucet v0.1.5 introduces guided first-run setup, batch transaction modes, background server mode, and improved telemetry controls.

[Introducing Faucet: Turn Your SQL Database into a REST API](https://faucetdb.ai/blog/introducing-faucet/) (Feb 24, 2026): Faucet is a free, open-source single binary that turns your SQL database into a REST API and MCP server. Here's why we built it and how it works.
