Databases
Harbour supports PostgreSQL, MySQL, MariaDB, and SQLite lifecycle management.
MongoDB is a connection-only selection: Harbour can configure an isolated
MONGODB_DATABASE name and optionally own the local Compose container, but it
never creates, marks, migrates, or destroys the MongoDB database itself.
'database' => [
'enabled' => true,
'connection' => 'pgsql',
'sqlite_path' => 'database/harbour.sqlite',
'migrate' => true,
'seed' => false,
],
Setup derives a context-safe workspace database name, connects through Laravel/PDO configuration, creates the database, writes a random ownership marker, persists the exact resource evidence, applies the connection to Laravel, and runs normal migrations. Seeding is opt-in.
Repeated setup uses normal migrations; it never runs migrate:fresh implicitly.
PostgreSQL and MySQL/MariaDB
Harbour uses PDO instead of requiring createdb, dropdb, psql, or mysql executables. Identifiers are validated and quoted for the driver.
Before deletion, state, driver, server fingerprint, database name, workspace ID, and the marker stored inside the database must agree. A current .env database name is not ownership evidence.
If local Harbour state is accidentally removed while its database survives, the next pending setup may recover that database only when it contains one structurally valid Harbour marker for the exact same workspace. Recovery atomically rotates the resource ID and ownership token into the new state. Harbour still refuses unmarked databases, malformed markers, and markers for another workspace.
SQLite
The default file is database/harbour.sqlite. Its path must stay inside the
checkout and may not traverse symlinks. Harbour creates and removes only a file
recorded as Harbour-owned. The same narrowly guarded state-loss recovery used
for server databases applies to an existing SQLite file; arbitrary pre-existing
files are never adopted.
Shared services
A single PostgreSQL or MySQL daemon can host many Harbour databases. Sail, Herd, a native service manager, or a long-lived Docker container may provide that daemon. Harbour owns the logical workspace database, not the shared server.