Skip to content

FH06 — Invalid SQL name

Group: Structure · Severity: error · Run by: validate and lint

A name does not satisfy the SQL-on-FHIR naming invariants:

  • Column and constant names must match the sql-name invariant ^[A-Za-z][A-Za-z0-9_]*$.
  • The view name must match the cnl-0 invariant ^[A-Z][A-Za-z0-9_]{1,254}$ (starts uppercase, 2–255 chars).

These mirror the spec’s StructureDefinition constraints so generated column and table names are SQL-safe.

A column name starting with a digit triggers FH06:

{
"resource": "Patient",
"select": [{ "column": [{ "name": "1bad", "path": "id" }] }]
}
error [FH06] (1bad): column name `1bad` is not a valid SQL name

Rename to start with a letter and use only letters, digits and _ (e.g. bad1). For the view name, start with an uppercase letter.