forgedb validate

Parse and validate a .forge schema, its naming conventions, and optionally its UI component references.

Parse the schema, report its statistics (models, fields, relations), and check semantic rules such as PascalCase model names. Use it as a pre-flight before generate or in CI.

Synopsis#

forgedb validate [--strict] [--schema-only] [--implementations] [--components] [--schema <PATH>]

Flags#

FlagType / defaultMeaning
--strictbool (false)Exit non-zero on validation errors — today only --components file-reference errors. Syntax/semantic errors already fail without it; advisory lints stay advisory.
--schema-onlybool (false)Validate syntax only; skip the semantic checks.
--implementationsbool (false)Check @computed field implementations. Accepted but not yet enforced — a documented no-op until schema expressions land.
--componentsbool (false)Check UI component references (tsx://, jsx://, api://).
-s, --schema <PATH>string (auto-discover)Schema file path. Auto-discovery looks for schema.forge, schema.lang, schema.forgedb.

--implementations is a no-op

The --implementations flag is parsed and accepted but does nothing yet. The real check — verifying every @computed field resolves — lands with the @computed(<expr>) schema- expression feature. Do not rely on it to catch anything today.

`--strict` does not check computed/view fields

--strict does not enforce @computed/view implementations — that enforcement lands with the @computed(<expr>) feature (#46). Its only effect today is to turn --components file-reference errors into a non-zero exit. Malformed syntax and semantic errors (bad names, dangling relations, duplicate fields) already fail validation without --strict; the missing-id / missing-timestamp lints stay advisory (exit 0) either way.

Examples#

Validate the schema in the current directory:

forgedb validate

Syntax-only check of a specific file:

forgedb validate --schema-only --schema ./schema.forge

Strict validation including component references:

forgedb validate --strict --components

Search documentation

Find pages across the ForgeDB docs