{% extends "base.html" %} {% block title %}Database — FreeWeight{% endblock %} {% block content %}

Database

Your measurement history lives here and nowhere else. Nothing on this page removes anything without first showing you exactly what it would remove, and models and machines are never removed by a result deletion — what exists outlives what was measured.

{% if error %} {% endif %} {% if notice %}
{{ notice }}
{% endif %} {% if stats %}

Statistics

Size on disk
{{ stats.status.size_bytes | bytes }}

{{ stats.status.dialect }}

Schema revision
{{ stats.status.current_revision or '—' }}

{% if stats.status.is_at_head %}At head.{% else %}Head is {{ stats.status.head_revision }} — run freeweight db upgrade.{% endif %}

Integrity
{{ 'ok' if stats.status.integrity_ok else 'check failed' }}

{{ stats.status.integrity_detail }}

Backups
{{ stats.backup_count }}

{% if stats.last_backup_at %}Latest {{ stats.last_backup_at | timestamp }}{% else %}None taken yet{% endif %}

Artifacts
{{ stats.artifact_bytes | bytes }}

On disk beside the database.

Backups kept
{{ backup_retention }}

Automatic pre-migration backups, oldest rotated away. Results themselves are never deleted on a timer — a measurement does not expire. Remove a model's results when you remove the model. Change it on Settings.

Row counts

{% for table, count in stats.status.table_row_counts | dictsort %} {% endfor %}
Every table this application owns.
TableRows
{{ table }}{{ count }}
{% endif %}

Delete results

{% include "partials/_csrf.html" %}

run takes a ULID or prefix · model a canonical ID · suite a suite key · before an RFC 3339 instant · all takes no selector.

{% if preview %}

Preview — nothing has been deleted yet

{{ preview.summary_line() }}

{% if preview.run_ids %}
{% for table, count in preview.removed_counts | dictsort %} {% endfor %}
Rows this deletion would remove, by table.
TableRows removed
{{ table }}{{ count }}
Total{{ preview.total_rows }}
{% for table, count in preview.preserved_counts | dictsort %} {% endfor %}
Rows this deletion leaves alone.
TableRows kept
{{ table }}{{ count }}

{% if preview.will_backup %} A backup will be taken automatically first, because this removes {{ preview.total_rows }} rows. {% else %} No automatic backup: this is below the threshold. Take one from the button below if you want one. {% endif %}

{% include "partials/_csrf.html" %}
{% else %}

Nothing matches this selection, so there is nothing to confirm.

{% endif %}
{% endif %} {% if outcome %}

Deleted

{{ outcome.deleted_counts.values() | sum }} rows removed across {{ outcome.preview.run_ids | length }} runs.

{% if outcome.backup_path %}

A backup was written to {{ outcome.backup_path }} first.

{% endif %}
{% for table, count in outcome.preview.removed_counts | dictsort %} {% endfor %}
What was removed, against what the preview said.
TablePreviewed Removed
{{ table }} {{ count }} {{ outcome.deleted_counts.get(table, 0) }}
{% for table, count in outcome.preserved_counts_after | dictsort %} {% endfor %}
Untouched, counted after the deletion committed.
TableRows
{{ table }}{{ count }}
{% endif %}

Maintenance

{% include "partials/_csrf.html" %}
{% include "partials/_csrf.html" %}

Backups are written inside the data directory with mode 0600 and are never sent anywhere. Restore is deliberately command-line only: freeweight db restore <path> --yes.

{% endblock %}