docs: adr 0012 sqlite only
This commit is contained in:
@@ -150,3 +150,7 @@ Removing `repos` now would break every one of those 40 sites for no gain this pl
|
||||
it transitively via presentation/worker's default features` — pre-existing, not introduced or
|
||||
fixed by this plan, and invisible to `make check`'s workspace-wide `cargo test`, which enables
|
||||
the feature transitively.
|
||||
|
||||
---
|
||||
|
||||
Superseded in part by [ADR-0012](0012-sqlite-is-the-only-backend.md): the postgres backends, crates and features mentioned above no longer exist; SQLite is the only backend.
|
||||
|
||||
@@ -259,3 +259,7 @@ recorded under Known follow-ups below, which is also pre-existing.
|
||||
established as legitimate — test helpers build a real `Repositories` and call `composition::build_deps`.
|
||||
`check-presentation-adapters` intentionally does not scan that section, and it does not need to:
|
||||
`composition` is not an adapter crate.
|
||||
|
||||
---
|
||||
|
||||
Superseded in part by [ADR-0012](0012-sqlite-is-the-only-backend.md): the postgres backends, crates and features mentioned above no longer exist; SQLite is the only backend.
|
||||
|
||||
@@ -365,3 +365,7 @@ still fails with the same two pre-existing errors. This branch neither fixed nor
|
||||
leaked into `presentation`. ADR-0008's caveat carries over unchanged: the guard assumes directory
|
||||
name equals package name, true for all 28 today but not enforced.
|
||||
- The deferred items in ADR-0005/0006/0007/0008 are otherwise unaffected by this plan.
|
||||
|
||||
---
|
||||
|
||||
Superseded in part by [ADR-0012](0012-sqlite-is-the-only-backend.md): the postgres backends, crates and features mentioned above no longer exist; SQLite is the only backend.
|
||||
|
||||
19
docs/adr/0012-sqlite-is-the-only-backend.md
Normal file
19
docs/adr/0012-sqlite-is-the-only-backend.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# SQLite is the only database backend
|
||||
|
||||
Movies Diary supports exactly one database: SQLite. The PostgreSQL adapters and the `DATABASE_BACKEND` runtime switch are removed.
|
||||
|
||||
## Context
|
||||
|
||||
The repository carried two adapter families, `sqlite*` and `postgres*`, across five crate pairs (base repositories, social, federation, search, event queue). They were roughly 80% copy-pasted, about 6,000 lines, differing mainly in placeholder syntax (`?` vs `$1`), datetime types and FTS (FTS5 vs tsvector). Every port change had to be made twice. The postgres family had no tests, so it was never verified to work, and the owner has only ever run SQLite. It was dead weight that doubled the maintenance cost of every storage change and the number of feature combinations to build.
|
||||
|
||||
## Decision
|
||||
|
||||
Delete the `postgres*` crates and the backend switch. SQLite is the sole implementation of the storage ports. If a second backend is ever needed, it is added back deliberately, with tests, behind the existing ports rather than kept alive speculatively.
|
||||
|
||||
## Consequences
|
||||
|
||||
- One adapter family to change per port; roughly 6,000 fewer lines and five fewer crates to build and review.
|
||||
- `DATABASE_BACKEND` is ignored. If it is set to anything other than `sqlite`, startup logs one warning ("DATABASE_BACKEND is ignored; SQLite is the only backend") and continues.
|
||||
- Cargo features collapse to `federation` (default) and `nats`. `sqlite` and `sqlite-federation` remain as deprecated aliases so existing deploy commands (`FEATURES=sqlite,sqlite-federation,nats`) still build. They may be removed in a future release once deploy scripts no longer pass them.
|
||||
- Existing PostgreSQL deployments are not supported and have no migration path from this repository.
|
||||
- ADR-0006, ADR-0008 and ADR-0009 mention postgres features and crates; they carry a note that they are superseded in part by this ADR and are otherwise left as written.
|
||||
Reference in New Issue
Block a user