forgedb 0.2.0

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 build"
description: "Validate, regenerate, and compile production-ready ForgeDB artifacts for native or WASM targets."
purpose: "reference"
---
Produce production artifacts end to end: validate the schema, regenerate the code (baking
the `[runtime]`/`[storage]` config from `forgedb.toml` into the output), then compile.
`build` always regenerates with force, so a repeated build never fails on existing files.

## Synopsis

```bash
forgedb build [--release] [--target <native|wasm|both>] [--output <DIR>] [--schema <PATH>] [--no-api]
```

## Flags

| Flag | Type / default | Meaning |
|---|---|---|
| `--release` | bool (**true**) | Build with optimizations. On by default. |
| `-t`, `--target <T>` | string (`native`) | Compile target: `native`, `wasm`, or `both`. |
| `-o`, `--output <DIR>` | string (`[generate].output`, else `generated`) | Output directory for generated code. |
| `--schema <PATH>` | string (auto-discover) | Schema file path. |
| `--no-api` | bool (false) | Skip API generation — generate only `rust`, the `node --sdk` TypeScript SDK, and `stubs`. |

<Callout type="note" title="build = validate + generate + compile">
`build` first runs a syntax-only validation, then generates (`all`, or the reduced set
with `--no-api`), then compiles the chosen target. The generate step honors the same
config knobs as [`generate`](/docs/cli/generate/).
</Callout>

## Examples

Build the native release artifacts:

```bash
forgedb build
```

Build both native and WASM:

```bash
forgedb build --target both
```

Build without the REST API server:

```bash
forgedb build --no-api
```