micasa

Data Storage

micasa stores everything in a single SQLite database file. This page covers how data is stored and how to manage it.

Database file#

By default, the database lives in your platform’s data directory:

PlatformDefault path
Linux~/.local/share/micasa/micasa.db
macOS~/Library/Application Support/micasa/micasa.db
Windows%LOCALAPPDATA%\micasa\micasa.db

See Configuration for how to customize the path.

The database path is shown in the tab row (right-aligned) so you always know which file you’re working with.

Schema#

micasa uses GORM for database access. The database is created on first run, and new tables or columns are added automatically on startup. See Upgrades for what this covers and what it doesn’t.

Tables#

TableDescription
house_profilesSingle row with your home’s details
projectsHome improvement projects
project_typesPre-seeded project categories
quotesVendor quotes linked to projects
vendorsShared vendor records
maintenance_itemsRecurring maintenance tasks
maintenance_categoriesPre-seeded maintenance categories
incidentsHousehold issues and repairs
appliancesPhysical equipment
service_log_entriesService history per maintenance item
documentsFile metadata + attachments linked to records
deletion_recordsAudit trail for soft deletes/restores

Pre-seeded data#

On first run, micasa seeds default project types (Renovation, Repair, Landscaping, etc.) and maintenance categories (HVAC, Plumbing, Electrical, etc.). These are reference data used in select dropdowns.

Backup#

Your database is a single file. Back it up with cp:

cp "$(micasa --print-path)" ~/backups/micasa-$(date +%F).db

Since SQLite supports hot backup, you can safely copy the file while micasa is running.

Soft delete#

micasa uses GORM’s soft delete feature. When you delete an item, it sets a deleted_at timestamp rather than removing the row. This means:

Referential integrity guards#

Soft deletion respects foreign key relationships:

Portability#

The database is a standard SQLite file. You can:

The file uses a pure-Go SQLite driver (no CGO), so the binary has zero native dependencies.

Upgrades#

micasa does not yet have a schema migration system. New columns and tables added in future versions will appear automatically when you upgrade (GORM’s AutoMigrate handles that), but some kinds of schema changes are not supported by this mechanism:

If a future release requires one of these changes, we’ll ship a migration tool or document the manual steps. Until then, upgrading micasa will never lose your data – the worst case is a column that sticks around after it stops being used.

What you should do#

Back up before upgrading. The database is one file:

cp "$(micasa --print-path)" ~/backups/micasa-$(date +%F).db

If an upgrade goes wrong, restore from the copy and pin the previous version until a fix is released.

What we’ll do#

If a future major version (2.0) requires breaking schema changes, it will include a migration tool that handles the upgrade automatically. The goal: you upgrade the binary, launch it, and everything just works – or you get a clear error telling you what to do.

A note on scale#

micasa manages one house. Yours. The expected dataset is something like 1 house profile, a few dozen projects, a handful of appliances, and maybe a few hundred maintenance entries if you’ve been religiously logging every generator spark plug, oil change, and leaf you’ve raked since the Clinton administration. The entire database will comfortably fit on a floppy disk, assuming you can find one. Attach enough PDFs of appliance manuals and warranty certificates and you might graduate to two floppy disks. Exciting times.

There is no sharding strategy. There is no read replica. The query planner’s hardest decision is whether to use the index. We have not load-tested the application to determine peak concurrent homeowner throughput, but we’re confident the answer is “one” and the bottleneck is “the homeowner going to get a snack.”

SQLite caps out at 281 terabytes. If your maintenance records are approaching even a fraction of that, you do not have a database problem – you have a house problem. That is less “home maintenance” and more “the Winchester Mystery House is my primary residence and I am writing down every nail.”

If you’re managing enough houses to worry about database performance, you’re a property management company, and you should probably use property management software.

LLM data exposure#

If you enable the optional LLM chat, micasa sends database contents to the configured LLM endpoint. By default this is localhost (Ollama), so data stays on your machine. If you configure a remote endpoint, your home data travels over the network. See the Data and privacy section of the LLM chat guide for details on exactly what is sent.

Demo mode#

micasa --demo creates an in-memory database populated with fictitious sample data. To persist demo data, pass a file path:

micasa --demo /tmp/demo.db

Demo data includes sample addresses, phone numbers (all 555-xxxx), and example.com email addresses.