Description
Query SQLite and Postgres from LM Studio — inspect schemas, list tables, and sample rows. Read-only by default.
Stats
174 Downloads
Description
Query SQLite and Postgres from LM Studio — inspect schemas, list tables, and sample rows. Read-only by default.
Stats
174 Downloads
Last updated
Updated on August 31byProject Files
README
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.
databaseSingle tool with four actions.
queryRun 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.
tablesList all tables in the database.
database(action="tables") database(action="tables", db_type="postgres")
schemaShow columns, types, nullability, and primary key info for a table.
database(action="schema", table="users")
sampleShow 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 raisedThis plugin is free and open source. If you find it useful, consider supporting development:
| Tier | Amount | Perks |
|---|---|---|
| ☕ Coffee | $3 | Name in credits |
| 🍔 Lunch | $10 | + Priority support |
| 🍕 Pizza | $25 | + Name in README |
| 🏆 Founding | $50 | + Lifetime support, consultation |
Every coffee helps keep this project alive! ☕