SQL · template

Give your agent your SQLite schema, without a login

One file in. Tables, types and foreign keys that an assistant can use.

Import a SQLite schema file. Then your assistant knows the tables, types and foreign keys, can say what a change touches, and can write GraphQL, Protobuf, Avro or JSON Schema types.

What you get

Your assistant gets the tables, columns, types and foreign keys of a SQLite database from one file. It can then tell you which tables a change touches, and write typed code for them. It never gets a login and never sees a row.

What we didWhat CoreModels answeredTime
Imported the schema file16 tables, 89 columns5 s
Asked what points to the table film3 tables: film_actor, film_category, inventory1 s
Asked for GraphQL types of film2 types with required fields1 s

Recorded on 4 December 2026 with the Sakila sample database for SQLite, a film rental shop kept by the jOOQ team (repository). Licence: BSD. We also loaded this example into SQLite 3.51 and read the file that .schema wrote: the same 16 tables and 89 columns.

What you need

  • A CoreModels account with one project. Every plan starts with a 14-day free trial; a card is required to start.
  • An assistant that can use MCP servers, for example Claude Code or Cursor.
  • No SQLite login. CoreModels reads a file with CREATE TABLE statements.

Run it

1. Connect your assistant

In Claude Code, run this command. Then sign in when it asks. This address can write to your projects, because an import creates a model.

claude mcp add --transport http coremodels https://go.coremodels.io/mcp-admin

Cursor, Claude Desktop and other clients: connect guide.

2. Import the schema

The example is a public file, so you can run it as it is.

Create a CoreModels project named "SQLite example". Then call import_schema on it with format "sql" and this customFileUrl:
https://raw.githubusercontent.com/jOOQ/sakila/2df186f3e2332cc16dbadeb9b06b95e6361d7517/sqlite-sakila-db/sqlite-sakila-schema.sql

Your assistant calls create_project, then import_schema. The answer we got:

import_schema (part of the answer)

{
  "succeeded": true,
  "format": "sql",
  "decoded": {
    "types": 16,
    "elements": 89,
    "taxonomies": 0,
    "listItems": 0
  },
  "written": {
    "types": 16,
    "elements": 89,
    "taxonomies": 0,
    "listItems": 0
  }
}

decoded is what the file has. written is what is in your project now. The two are equal, so nothing was lost between them. The full answer also lists what the model does not hold, for example indexes and default values.

3. Ask before you change a table

A foreign key points from another table to this one. In a large database that is easy to miss.

Call analyze_concept_impact for "film" in this project. Which tables point to it, and with which column?

Your assistant calls analyze_concept_impact. The answer we got:

analyze_concept_impact (part of the answer)

{
  "label": "film",
  "kind": "Type",
  "governedUsage": [
    {
      "kind": "referencedByElement",
      "description": "Referenced by element 'film_id' on type 'inventory'."
    },
    {
      "kind": "referencedByElement",
      "description": "Referenced by element 'film_id' on type 'film_actor'."
    },
    {
      "kind": "referencedByElement",
      "description": "Referenced by element 'film_id' on type 'film_category'."
    }
  ]
}

This call only reads. The full answer also lists the columns of the table.

4. Get types for your code

The model writes other formats from the same tables. This is GraphQL.

Call export_schema with format "graphql" for the type film only.

Your assistant calls export_schema. The answer we got:

export_schema (the content)

scalar DateTime

type film {
  description: String
  last_update: DateTime!
  film_id: Int!
  release_year: String
  original_language_id: language
  rating: String
  title: String!
  rental_rate: Float!
  rental_duration: Int!
  special_features: String
  length: Int
  replacement_cost: Float!
  language_id: language!
}

type language {
  last_update: DateTime!
  name: String!
  language_id: Int!
}

Other formats are JSON Schema, Protobuf, Avro, LinkML, OWL and a data contract (ODCS).

Now with your own project

The file has no rows in it. Then give your assistant the prompt.

sqlite3 your.db .schema > schema.sql
Create a CoreModels project for our database. Import schema.sql with import_schema, format "sql". Show me decoded and written, and the list of what was not kept. Then tell me which tables point to YOUR_TABLE.

What it does not do

  • Indexes, default values, triggers, views and functions are not kept. The answer names each one.
  • The length of a text column and the mark for a primary key are named in the answer and not kept in the model.
  • Your assistant sends your own file as text. With a very large schema, send the tables you need. sqlite3 your.db ".schema film" writes only the tables you name.
  • The pass or fail check of our connectors does not cover a SQL file. After a change, import the new file again.
  • CoreModels does not connect to your SQLite server.

← Back to SQL

Start building

14-day free trial. Builder $49/mo after the trial. Cancel any time.