---
title: "Generate TypeScript models from SQL DDL"
method: POST
path: "/api/sql/typescript"
tags: ["Sql"]
---

# Generate TypeScript models from SQL DDL

`POST /api/sql/typescript`

## Request body

- SqlTypeScriptRequest
  - `ddlSource` string, nullable, required
  - `generateInterfaces` boolean, nullable
  - `generateNavigationProperties` boolean, nullable
  - `generateValidationAnnotations` boolean, nullable
  - `initializeProperties` boolean, nullable
  - `singularTypeNames` boolean, nullable
  - `precisionSafeDecimals` boolean, nullable
  - `jsonAs` string, nullable
  - `schemaPrefix` string, nullable

## Response `200`

OK

- CodeGenerationResult
  - `executionTimeInMilliseconds` integer
  - `files` CodeFileResult[], nullable
    - `name` string, nullable
    - `path` string, nullable
    - `content` string, nullable
  - `warnings` string[], nullable
  - `additionalInfo` AdditionalInfo
    - `message` string, nullable, required
    - `level` string, nullable — Severity level: info, warning, or critical
    - `actionUrl` string, nullable — Optional URL for the client to act on (e.g., migration guide, changelog)

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.dev/metaengine/apis/metaengine-api.md) · [All operations](https://skmtc.dev/metaengine/apis/metaengine-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/metaengine/metaengine-api/revisions/7bba577610ce/schema)
