forgedb 0.3.1

ForgeDB — an application database generator. Compiles a declarative .forge schema into tailored Rust database code, a TypeScript SDK, and a REST API.
Documentation
---
title: "forgedb validate"
description: "Parse and validate a .forge schema, its naming conventions, and optionally its UI component references."
purpose: "reference"
---
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

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

## Flags

| Flag | Type / default | Meaning |
|---|---|---|
| `--strict` | bool (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-only` | bool (false) | Validate syntax only; skip the semantic checks. |
| `--implementations` | bool (false) | Check `@computed` field implementations. **Accepted but not yet enforced** — a documented no-op until schema expressions land. |
| `--components` | bool (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`. |

<Callout type="warning" title="--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.
</Callout>

<Callout type="warning" title="`--strict` does not check computed/view fields">
`--strict` does **not** enforce `@computed`/view implementations — that enforcement lands
with the `@computed(<expr>)` feature
([#46](https://github.com/hoodiecollin/forgedb/issues/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.
</Callout>

## Examples

Validate the schema in the current directory:

```bash
forgedb validate
```

Syntax-only check of a specific file:

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

Strict validation including component references:

```bash
forgedb validate --strict --components
```