README.md
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.
cd database-plugin npm install npm run build
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.
Single tool with four actions.
Run a SQL statement.
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")
Write statements (INSERT, UPDATE, DELETE, DROP, etc.) are blocked unless Allow Write Queries is enabled.
List all tables in the database.
database(action="tables") database(action="tables", db_type="postgres")
Show columns, types, nullability, and primary key info for a table.
database(action="schema", table="users")
Show the first 10 rows of a table.
database(action="sample", table="orders")
Shared parameters:
db_type ā sqlite (default) or postgresdb_path ā path to SQLite file (overrides config)dsn ā Postgres connection string (overrides config)sql ā SQL for the query actiontable ā table name for schema / sampleExplore 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 raised