db-connector

Retrieve database rows and schema through a read-only policy gate.

10|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/narailabs/narai-primitives --skill db-connector
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-connector
Source: https://github.com/narailabs/narai-primitives/tree/main/plugins/db-connector/skills/db-connector
Command: npx skills add https://github.com/narailabs/narai-primitives --skill db-connector

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you answer database questions (rows, tables, columns, and schema details) while enforcing read-only safety and preventing writes or privilege changes from reaching the underlying drivers.

Core Features & Use Cases

  • Safe database querying with policy enforcement: Ensures every statement is checked by a policy gate before any driver loads or any connection opens, returning structured results or a safe SQL preview.
  • Schema introspection and selective listing: Retrieves tables/columns with optional filtering (e.g., table-name patterns like users%).
  • Multi-database support via pluggable drivers: Covers PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, DynamoDB, and Oracle through the connector framework.

Use cases include answering “what changed?” or “what’s the latest rows in this table?” and exploring “what columns exist?” without risking accidental writes.

Quick Start

Run db-connector --action query --params '{"env":"<environment>","sql":"SELECT * FROM users LIMIT 5"}' to get the query results in the connector’s JSON envelope.

Frequently Asked Questions about db-connector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a read-only SQL query safely without risking accidental writes?

To run a read-only SQL query safely, use a policy gate that checks every statement before any driver loads or connection opens. This mechanism blocks unsafe operations, escalates writes for approval, and returns structured JSON results for safe analytics.

What happens when a delete or admin operation is attempted during database schema introspection?

During database schema introspection, attempting a delete or admin operation triggers a hard denial for privilege statements. The system returns the formatted SQL for delete or admin operations without executing them, ensuring the underlying database remains protected.

Can I use a single connector framework to query multiple database engines like PostgreSQL, MongoDB, and Oracle?

Yes, you can query multiple database engines including PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, DynamoDB, and Oracle. The connector framework uses pluggable drivers to support these diverse environments while maintaining consistent read-only safety.

How do I retrieve table and column names from a database using a pattern filter?

To retrieve table and column names, use the schema introspection action with optional filtering. You can apply table-name patterns like users% to selectively list tables and columns, returning the discovery results in a structured JSON envelope.

Does the policy gate block write operations before or after the database connection opens?

The policy gate blocks write operations before the database connection opens. It enforces read-only safety by validating every statement prior to any driver load or connection initialization, guaranteeing that unsafe queries never reach the underlying database drivers.

Why are my query results returned in a JSON envelope with status codes?

Query results are returned in a JSON envelope with status codes to guarantee safety behavior and provide structured output. This format includes relevant fields and status indicators, ensuring consistent handling of controlled result truncation and blocked operations.