SvGrid Studio

Studio is the grid-centric data-app layer in @svgrid/enterprise: turn a database or schema into a production-ready CRUD screen - grid, edit form, and SvelteKit API route - in seconds. One EntitySchema drives the grid columns, the edit form, validation, and the generated code.

A CRUD screen generated by SvGrid Studio: sortable, filterable grid with a native pager, over a live data source.

It is part of the Enterprise license and is soft-gate only - everything runs unlicensed, it just nudges. See licensing.

New to Studio? Follow the step-by-step Getting started guide - from an empty app to a working Customers screen, no prior SvGrid experience assumed.

Prefer not to write code? Build the same app visually - point, click, preview, then press one button to generate it. Start with Build it visually, or open a one-click sample app.

Live demos: Data-app Studio (the whole stack: grid + edit modal + schema designer) · Live SQL (real Postgres in the browser via PGlite) · Supabase (your own hosted Postgres, straight from the browser) · Chart (a live chart panel beside the grid; click to filter).


A CRUD app in under a minute

npm i @svgrid/grid @svgrid/enterprise
npx @svgrid/studio add customers --db postgres --url "$DATABASE_URL"
npm run dev            # open /customers

You get three files - the entity schema, a SvelteKit +server.ts API route, and a +page.svelte screen - and a working /customers page with search, sort, pagination, multi-select delete, and create/edit. Re-running add is safe: only the svgrid:managed regions are regenerated.


How it fits together

One EntitySchema is the single source of truth. The grid columns, the edit form, the dashboard, the generated SvelteKit code, and the data layer all derive from it - so a change to the schema flows everywhere at once.

One EntitySchema drives the grid, edit form, dashboard, generated app, and every data source; author it with the visual designer, the CLI, or the AI generator.


Data binding options

Studio binds a screen to data through one small contract - ServerDataSource (read + create + update + delete). Every option below implements it, so the grid, form, sorting, filtering, and pagination work identically no matter where the data lives. Pick your source:

Option Use it for Guide
Databases PostgreSQL, Supabase, MySQL / MariaDB, SQL Server, SQLite Databases
Drizzle schema scaffold from a Drizzle schema.ts file (no live DB needed) Drizzle schema
REST / custom API an existing HTTP API, or any backend you wire by hand REST & custom APIs
In-memory prototypes, tests, static data, seeding a schema In-memory

New to how binding works? Start with Data binding - the ServerDataSource contract and how sort / filter / page / CRUD flow.


Three ways to build

All three produce the same output, because they share one scaffold() core.

1. CLI - npx @svgrid/studio add ... (deterministic, no AI required).

2. AI / MCP - with @svgrid/mcp configured, ask your agent (Claude Code, Cursor, ...) to build a screen for a table; it calls introspect_source -> scaffold_entity, and the output is compile-verified before it's written.

3. Visual designer - <SvSchemaDesigner>: author the schema, preview the grid + form live, and click Generate code. For a whole multi-screen app, the visual app designer composes grids, charts, dashboards, and master-detail across many entities.

The visual schema designer: edit fields, types, and validation on the left; live grid + edit-panel preview on the right.

Here a ready-made CRM sample is open in the app designer - KPI tiles and a deal-pipeline chart, all built by pointing and clicking, no code:

A CRM sample loaded in the visual app designer: KPI tiles (open deals, pipeline value, average deal size) and a bar chart of deal value by stage.


What you get in a generated screen

A shippable data screen, not a stub:

The create/edit modal with built-in validation -


The building blocks (use them directly)

Piece What
EntitySchema one model -> grid columns (schemaToColumns) + form fields (schemaToFormFields) + validation
SvGridEditPanel schema-driven create / edit form (drawer / modal / inline), with FK lookup fields
createRelationLookup / SvLookupInput searchable foreign-key picker over any ServerDataSource (Relations)
SvGridMasterDetail expand a row into a nested grid of related records
createSqlDataSource a ServerDataSource over any SQL client (execute(text, params))
createSupabaseDataSource a ServerDataSource over a supabase-js client (browser + RLS)
createSupabaseRealtime live grid: refetch / flash rows on Postgres change streams (Real-time)
SvAuthGate / createSupabaseAuth secure a screen behind Supabase Auth; RLS scopes data per user (Auth)
SvSchemaChart a chart bound to the schema; aggregates client-side or via a source's getAggregate (GROUP BY)
scaffoldApp scaffold a whole multi-entity app - nav + home + every screen
createRestDataSource a ServerDataSource over an HTTP/JSON API (overridable request/response)
introspectSupabaseTable detect a Supabase table's columns -> EntitySchema, from the browser
createKitDataSource / createKitHandlers the SvelteKit client + server transport
createServerDataSource server-side sort / filter / page + optimistic CRUD
SvSchemaDesigner the visual schema designer + live preview + code generation

The grid renders its own sort, filter, and pagination UI in server mode via externalSort / externalFilter / externalPagination - you pass rowCount and pageIndex, it emits change events, you fetch the page.


Production & enterprise ready


All Studio topics

Start here

Data binding

Build

Reference

Tutorials

Deploy & style

Help

Enterprise