Quickback Docs
Database Schema

Display Column and Input Hints

Choose the display column that labels a record, set the CMS default sort, and give the CMS input hints for each field.

Presentation settings on a table: the display column, which labels a record in references and responses; defaultSort, the CMS list order; and input hints, which choose the CMS editor for a field. Start at Database Schema for the table forms.

Display Column

When a table has foreign key columns (e.g., departmentId referencing departments), Quickback can automatically resolve the human-readable label in GET and LIST responses. This eliminates the need for frontend lookup calls.

Auto-Detection

Quickback auto-detects the display column by checking for common column names in this order:

name → title → label → headline → subject → code → displayName → fullName → description

If your departments table has a name column, it's automatically used as the display column. No config needed.

Explicit Override

Override the auto-detected column with displayColumn:

export default defineTable(interviewStages, {
  // ... columns, firewall, guards, crud
  displayColumn: 'label',  // Use 'label' instead of auto-detected 'name'
  read: { access: { roles: ["hiring-manager", "recruiter"] } },
});

Default Sort

Set a default sort order for the CMS table list view with defaultSort:

export default defineTable(podcastEpisodes, {
  // ... columns
  defaultSort: { field: "createdAt", order: "desc" },
  firewall: [{ exception: true }],
  read: { access: { roles: ["PUBLIC"] } },
});

The CMS applies this sort when the table first loads. Users can still click column headers to change the sort order.

How Labels Appear in Responses

For any FK column ending in Id, the API adds a _label field with the resolved display value:

{
  "id": "job_abc",
  "title": "Senior Engineer",
  "departmentId": "dept_xyz",
  "department_label": "Engineering",
  "locationId": "loc_123",
  "location_label": "San Francisco"
}

The pattern is {columnWithoutId}_label. The frontend can find all labels with:

Object.keys(record).filter(k => k.endsWith('_label'))

Label resolution works within the same feature (tables in the same feature directory). System columns (organizationId, createdBy, modifiedBy) are never resolved.

For LIST endpoints, labels are batch-resolved efficiently — one query per FK column, not per record.

Input Hints

Control how the CMS renders form inputs for specific columns. By default the CMS infers the control from the column itself — q.timestamp() → date-time picker, q.date() → date picker, q.bool() → checkbox, q.int() / q.bigint() / q.smallint() → number, q.decimal() → text (so the exact string is sent), q.enum() → select, q.enum([...]).array() → multiple checkboxes that send an array, q.url() → URL input, q.json() → textarea that validates and sends JSON, and name patterns for plain text (*Url, *Notes, email). The registry carries the q column kind, so this works on SQLite too, where every timestamp is text at the SQL layer. Other .array() columns do not yet have a dedicated CMS editor. inputHints overrides the inference except for enum arrays, which must retain an array value:

export default defineTable(jobs, {
  inputHints: {
    status: "select",
    department: "select",
    salaryMin: "currency",
    salaryMax: "currency",
    description: "richtext",
  },
  // ... firewall, guards, crud
});

Available Hint Values

HintRenders As
richtextRich text editor (tiptap) — bold, italic, headings, lists, links. Stores HTML. Lazy-loaded in edit mode, rendered as formatted HTML in view mode.
selectDropdown select (single value)
multi-selectFalls back to the inferred control; enum arrays render as multiple checkboxes
radioRadio button group
checkboxCheckbox toggle
textareaMulti-line text input
lookupFK typeahead search
hiddenHidden from forms
colorColor picker
dateDate picker
datetimeDate + time picker
timeTime picker
currencyCurrency input with formatting

Input hints are emitted in the schema registry as inputHints on the table metadata, and the CMS reads them to render the appropriate form controls. The bundled CMS form renders richtext, select, checkbox, textarea, date, datetime, currency, number, email, url, and text today; any other hint falls back to the inferred control.

Rich Text Example

For fields that contain HTML content (e.g., blog posts, descriptions from RSS feeds), use "richtext":

export default defineTable(podcastEpisodes, {
  inputHints: { description: "richtext" },
  // ...
});

The CMS will:

  • View mode: Render the HTML with proper formatting (headings, lists, links, etc.)
  • Edit mode: Load a tiptap rich text editor with a toolbar (bold, italic, H2, H3, bullet/ordered lists, links, code, undo/redo)
  • Storage: HTML strings — no format conversion needed, compatible with external HTML content

On this page