enginiq-core
v1.0.2
Published
Core engine for EnginIQ AI database tools
Maintainers
Readme
EnginiQ Core
EnginiQ Core is the safe Postgres runtime behind EnginiQ.
It gives AI agents and developer tools a guardrailed way to work with Postgres and Supabase-hosted Postgres:
- Register and run structured tools
- Connect through a Postgres connector
- Block risky SQL operations
- Audit tool execution results
This package powers:
enginiq-clienginiq-mcp
Install
npm install enginiq-core pg dotenvUse this package when you want to give an agent safe Postgres capabilities instead of unrestricted SQL access.
Included tools
list_tablesdescribe_tableget_schemacreate_tableadd_columnrun_migrationquery
Safety model
EnginiQ Core currently blocks:
DROP DATABASEDROP SCHEMATRUNCATEALTER ROLEDELETEwithout aWHEREclause- operations on tables prefixed with
auth_,storage_, orsupabase_
For mutating tools, EnginiQ Core also supports trust-oriented execution modes:
dry_runread_onlyrequire_approvalwithapproval_token
These modes return SQL previews and safer execution responses instead of always applying changes.
Quick example
import {
Engine,
SupabaseConnector,
listTablesTool,
getSchemaTool,
} from "enginiq-core";
const engine = new Engine();
const connector = new SupabaseConnector(process.env.DATABASE_URL!);
engine.setConnector(connector);
engine.registerTool(listTablesTool(engine));
engine.registerTool(getSchemaTool(engine));
async function main() {
await engine.connect();
const schema = await engine.runTool("get_schema", {});
console.log(schema);
await engine.disconnect();
}
main().catch(console.error);Notes
- v0.1 is database-only.
- The default connector is Postgres-compatible and works well for Supabase-hosted Postgres.
runToolreturns a normalized success or failure envelope for callers like the CLI and MCP server.
