Inspect schema
litescope_schemaFetch database schema as JSON: tables, columns with types and constraints, and indexes. Supports SQLite, Cloudflare D1, and Turso.
Instructions
Load the schema of a SQLite or D1 database — tables, columns (name, type, not-null, primary key), and indexes. Returns JSON. Read-only.
Works with local files, D1, and Turso. For D1: set CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID and use source=d1://DB_ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Database source: a local file path (./app.db), a Cloudflare D1 DSN (d1://DB_ID when CLOUDFLARE_API_TOKEN+CLOUDFLARE_ACCOUNT_ID are set, or d1://TOKEN@ACCOUNT_ID/DB_ID), or a Turso DSN (turso://TOKEN@ORG/DB). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tables | Yes | Tables with their columns and indexes. |