> This page is for Structured Data Models Client.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/sdgm/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/sdgm/_mcp/server.

# SQLite Connector

> Connect Kumo Relational to data stored in SQLite

SQLite is what lets development and CI exercise the full sampling path, including SQL sampling, with no credentials. There are two ways to use it: sample in place with `SQLiteSource`, or read a table into memory with `read()`.

## Installation

```bash
pip install "structured-data-models-client[relational,sqlite]"
```

## Sample in place with `SQLiteSource`

```python
import adbc_driver_sqlite.dbapi
from sdm_client import PredictiveQuery, Schema
from sdm_connectors import SQLiteSource

connection = adbc_driver_sqlite.dbapi.connect("data.db")
source = SQLiteSource(connection)

schema = Schema.from_source(source, {"users": "USERS", "orders": "ORDERS"})
request = PredictiveQuery(
    "PREDICT COUNT(orders.*, 0, 30, days) FOR EACH users.user_id", schema
).materialize(indices=[7, 12, 3])
```

`tables` maps the names your query uses to the names in the database; leave it out to describe every table SQLite holds, under its own name. The connection is yours — close it when you are done sampling.

## Read into memory instead

```python
from sdm_connectors import read
from sdm_client import Schema

users = read("sqlite", database="data.db", table="USERS")
orders = read("sqlite", database="data.db", table="ORDERS")

schema = Schema.from_data({"users": users, "orders": orders})
```

`database` and `uri` are aliases for the same argument; pass exactly one. Pass `query=` instead of `table=` to read the result of an arbitrary SQL statement.

Review the inferred schema and relationships before predicting — see [Build a Schema](/sdgm/kumo-relational/user-guide/build-a-relational-graph/graph-creation).