Keywords: lm studio plugin, natural language sql, local database ai, sqlite ai, postgres ai, text to sql, database explorer, no cloud, private database access
Natural language database access for LM Studio. Query SQLite and Postgres databases in plain English ā inspect schemas, sample tables, run SQL, and explore your data without leaving the chat. Read-only by default; write operations opt-in.
Load the built plugin folder in LM Studio.
| Field | Default | Description |
|---|---|---|
| SQLite Database Path | (blank) | Absolute path to a .db or .sqlite file |
| Postgres Connection String | (blank) | e.g. postgresql://user:pass@localhost:5432/mydb |
| Allow Write Queries | false | Enable INSERT, UPDATE, DELETE, CREATE, DROP ā modifies your database |
| Max Result Rows | 200 | Truncate query results to this many rows |
Warning: Enable write queries only if you trust the model and the queries being run. There is no undo.
databaseSingle tool with four actions.
queryRun a SQL statement.
Write statements (INSERT, UPDATE, DELETE, DROP, etc.) are blocked unless Allow Write Queries is enabled.
tablesList all tables in the database.
schemaShow columns, types, nullability, and primary key info for a table.
sampleShow the first 10 rows of a table.
Shared parameters:
db_type ā sqlite (default) or postgresExplore an unfamiliar database:
"What tables are in this database and what does each one look like?" ā
database(action="tables")thendatabase(action="schema", table="...")per table
Answer a data question:
"How many orders were placed in the last 30 days?" ā
database(action="query", sql="SELECT count(*) FROM orders WHERE created_at >= date('now','-30 days')")
Sample before querying:
"Show me a few rows from the products table" ā
database(action="sample", table="products")
Postgres:
"Connect to my Postgres database and show the schema for the payments table" ā
database(action="schema", db_type="postgres", table="payments")
Max Result Rows ā raw database dumps are not possible unless the limit is raiseddb_pathdsn ā Postgres connection string (overrides config)sql ā SQL for the query actiontable ā table name for schema / samplecd database-plugin
npm install
npm run build
database(action="query", sql="SELECT * FROM users WHERE active = 1 LIMIT 20")
database(action="query", db_type="postgres", dsn="postgresql://...", sql="SELECT count(*) FROM orders")
database(action="tables")
database(action="tables", db_type="postgres")
database(action="schema", table="users")
database(action="sample", table="orders")