Tech dobz

preparing a tiny bit of magic...

    Overview

    Understanding Field Types in Zero

    Understanding Field Types in Zero

    When you create a database in Zero, each column has a field type that controls how values are validated, shown in the UI, and (optionally) encrypted. Picking the right type keeps data clean and makes filtering/searching easier.


    Core field types

    TypeWhat it’s forNotes
    char Short text (names, labels, titles) Good for single-line inputs.
    text Long text (notes, descriptions, secrets) Multi-line; can be encrypted if sensitive.
    integer, float Numbers (counts, amounts, ratings) Rejects non-numeric input.
    boolean Yes/No flags Shown as a toggle.
    date, time, datetime Schedules, logs, reminders Stored in ISO formats for consistency.
    email Email addresses Basic format validation.
    url Links Requires http:// or https://.
    password Credentials and secrets Rendered concealed; usually set to encrypted.
    choice Fixed options (status, category) Dropdown; define options (& optional default).
    file Attachments (images, PDFs, text files) See “File field” below for storage options.

    File field

    Attach documents to a row. You choose where bytes live:

    • Store on disk (recommended for large files): the file path is saved; bytes live under your local /media folder.
    • Store in DB (best for small text blobs like backup codes): bytes are kept inside the vault database.

    If marked encrypted, file contents are encrypted at rest. Text-based files can be previewed in-app when appropriate.


    Choice (dropdown)

    Define a closed set of values to keep data consistent. Typical examples:

    • Status: active, inactive, archived
    • Category: work, finance, personal

    You can also set a default option.


    Per-field options

    • Encrypted — store the value encrypted at rest. Use this for secrets like passwords, keys, or sensitive notes.
    • Hidden — show as concealed (e.g., •••) in the UI until revealed or copied.
    • Allow null — the database may store NULL for this field (truly optional).
    • Allow blank — the form accepts empty strings (distinct from NULL).
    • Store in DB (files) — for file fields only; keep bytes in the DB instead of on disk.

    Important: Encryption is explicit — a field is only encrypted if you enable it for that field. Zero doesn’t auto-encrypt fields for you.


    System fields (added by Zero)

    Every table includes a few maintenance columns you’ll see in exports and some views:

    • id — primary key
    • created, updated — timestamps
    • deleted_at — used for soft-deletes at table level
    • last_used — updated by certain actions (e.g., credential retrieval)
    • salt_id — internal reference used for per-row encryption

    These are managed by the app and should not be modified in templates.


    Tips for choosing the right type

    • Use password + encrypted for credentials (and keep a non-sensitive label like site for easy filtering).
    • Use choice for statuses/categories so filtering stays clean.
    • Prefer storing large files on disk; keep “store in DB” for small items.
    • Make optional fields nullable to avoid placeholder junk like "" or -.

    Updating fields and schema

    You can rename fields, add new ones, or change options from the schema editor. Be conservative when changing a field’s type once data exists, and avoid deleting columns you still need.

    Best practice: Create a backup before structural changes. You can do this from the Backups page.

    Next Up

    Organizing Your Data — Move, Clone & Clean Up