> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiparlance.org/llms.txt
> Use this file to discover all available pages before exploring further.

# First emitters

> Official AI Parlance Preview emitters — PostgreSQL through the full matrix

# First emitters

Phase C of the roadmap delivered the **first official emitters** (transpilers) for AI Parlance. They live in the monorepo as Preview targets — not npm-published packages yet, but real AST → artifact pipelines you can run with `aip emit`. **Phase D** deepens TypeScript, OpenAPI, and PostgreSQL toward a runnable happy path (see [ROADMAP](https://github.com/eudameron/aiparlance/blob/main/ROADMAP.md)).

***

## What “first transpiler” means here

Historically, the marketing site only had an **illustrative** playground. The language was specification-only.

With Phase C **M3–M6** and the matrix follow-up, the project ships **ten Preview emitters** from one validated AST:

| Target             | Package                  | CLI                   |
| ------------------ | ------------------------ | --------------------- |
| **PostgreSQL DDL** | `@aiparlance/sql`        | `aip emit sql`        |
| **OpenAPI 3**      | `@aiparlance/openapi`    | `aip emit openapi`    |
| **TypeScript**     | `@aiparlance/typescript` | `aip emit typescript` |
| **Go**             | `@aiparlance/go`         | `aip emit go`         |
| **MySQL DDL**      | `@aiparlance/mysql`      | `aip emit mysql`      |
| **Workers**        | `@aiparlance/workers`    | `aip emit workers`    |
| **Python**         | `@aiparlance/python`     | `aip emit python`     |
| **PHP**            | `@aiparlance/php`        | `aip emit php`        |
| **Docs**           | `@aiparlance/docs`       | `aip emit docs`       |
| **Tests**          | `@aiparlance/tests`      | `aip emit tests`      |

PostgreSQL was the **first** emitter because the docs treat it as the primary SQL target. OpenAPI, TypeScript, and Go completed the first multi-target wave; MySQL and the remaining matrix targets followed as Preview MVPs.

Together with `aip parse` and `aip validate` (Core + Infra + Security + Behavior), this is the **reference toolchain**.

***

## Pipeline

```txt theme={null}
.aip source
  → parse (AST)
  → validate (MUST rules)
  → emit sql | openapi | typescript | go | mysql | workers | python | php | docs | tests
```

One validated spec feeds all Preview emitters. Naming (snake\_case, FK `*_id`, plural tables) stays aligned across SQL targets, OpenAPI, and Go `json` tags.

***

## What each emitter produces

### PostgreSQL (`aip emit sql`)

* `CREATE EXTENSION IF NOT EXISTS pgcrypto`
* `CREATE TABLE` per `entity` (implicit `id`, timestamps; `deleted_at` when `soft_delete`)
* Types, `UNIQUE` / `NOT NULL`, enum `CHECK`s, `belongs_to` foreign keys
* `CREATE INDEX` from `index` blocks; `INSERT` from `seed` blocks

Golden: [`transpilers/sql/fixtures/minimal.sql`](https://github.com/eudameron/aiparlance/blob/main/transpilers/sql/fixtures/minimal.sql)

### OpenAPI 3 (`aip emit openapi`)

* Schemas `Entity` / `EntityCreate` / `EntityUpdate`
* CRUD paths when `crud Entity` is declared (honors `api.prefix`)
* Optional `securitySchemes` from `app.auth`

Golden: [`transpilers/openapi/fixtures/minimal.openapi.json`](https://github.com/eudameron/aiparlance/blob/main/transpilers/openapi/fixtures/minimal.openapi.json)

### TypeScript (`aip emit typescript`)

* Interfaces `Entity` / `EntityCreate` / `EntityUpdate`
* Runtime type guards (`isEntity`, `isEntityCreate`) — zero runtime deps
* Thin `entityPaths` helpers when CRUD is present

### Go (`aip emit go`)

* Structs with `json` tags; thin `net/http` CRUD stubs; `AuthMiddleware` from `app.auth`

### MySQL (`aip emit mysql`)

* MySQL DDL for specs with `database mysql` (see `examples/mysql-minimal.aip`)

### Workers / Python / PHP / Docs / Tests

MVP stubs from jobs/queues, dataclasses, classes, Markdown API refs, and CRUD fixtures — all Preview depth. See the [transpiler matrix](/en/specification#transpiler-matrix).

***

## Try it in one minute

```bash theme={null}
git clone https://github.com/eudameron/aiparlance.git
cd aiparlance && npm ci && npm run build

node packages/cli/dist/cli.js emit sql examples/minimal.aip
node packages/cli/dist/cli.js emit openapi examples/minimal.aip
node packages/cli/dist/cli.js emit typescript examples/minimal.aip
node packages/cli/dist/cli.js emit go examples/minimal.aip
node packages/cli/dist/cli.js emit mysql examples/mysql-minimal.aip
node packages/cli/dist/cli.js emit workers examples/ops-reference.aip
```

Full install and a complete CRUD story: [Get started here](/en/getting-started) · [CRUD walkthrough](/en/crud-walkthrough).

***

## Honest limits (v0.1 Preview)

* Language remains **draft**; emitter depth varies by target (MVP stubs vs richer SQL/OpenAPI).
* Full-tier examples **parse and validate**; not every Behavior/Security detail is reflected in every emitter yet (**Phase D** deepens TS / OpenAPI / SQL).
* No Nest/Express/Chi lock-in — TypeScript and Go emits stay thin (stdlib / interfaces).
* Site playground is still **illustrative** and must not be confused with these packages.

Matrix status: [Specification § Transpiler matrix](/en/specification#transpiler-matrix). Per-emitter scores: [Emitters](/en/emitters). Roadmap: [Phase D](https://github.com/eudameron/aiparlance/blob/main/ROADMAP.md).

***

## Related

* [Get started here](/en/getting-started)
* [CRUD walkthrough](/en/crud-walkthrough)
* [ROADMAP.md](https://github.com/eudameron/aiparlance/blob/main/ROADMAP.md)
* [CONTRIBUTING.md](https://github.com/eudameron/aiparlance/blob/main/CONTRIBUTING.md)
