npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

db-connector-for-ai-coding

v0.2.0

Published

A CLI tool for database connection, DDL extraction, and query validation to assist AI coding assistants

Readme

db-connector-for-ai-coding

A CLI tool for database connection, DDL extraction, and query validation to assist AI coding assistants.

Overview

db-connector-for-ai-coding is a Node.js CLI tool that bridges the gap between database schemas and AI code generation. It provides programmatic access to database structure information, enabling AI assistants (like Claude, ChatGPT, etc.) to work with real database structures without manual intervention.

Features

  • Database Connection Management: Connect to MySQL and PostgreSQL databases using configuration files
  • DDL Extraction: Extract table creation statements (DDL) with indexes, foreign keys, and constraints
  • Query Validation: Analyze SQL queries against table indexes to identify performance risks
  • AI-Friendly Output: Generate schema information in formats optimized for AI consumption
  • CLI Interface: Comprehensive command-line interface for all database operations

Installation

# Install globally
npm install -g db-connector-for-ai-coding

# Install locally in your project
npm install db-connector-for-ai-coding

Quick Start

# Generate sample configuration
db-connector config:init

# Test database connection
db-connector connect --config db-connect.config.yaml

# Extract DDL for all tables
db-connector extract-ddl --config db-connect.config.yaml

# Validate a SQL query
db-connector validate-query --config db-connect.config.yaml --query "SELECT * FROM users WHERE email = ?"

Configuration

Create a configuration file (db-connect.config.yaml or db-connect.config.json) with your database connection details:

type: mysql  # or postgres
host: localhost
port: 3306
username: your_username
password: your_password
database: your_database

CLI Commands

  • db-connect connect - Test database connectivity
  • db-connect extract-ddl - Extract table DDL statements
  • db-connect validate-query - Validate SQL queries against indexes
  • db-connect config:init - Generate sample configuration file
  • db-connect config:validate - Validate configuration syntax

Documentation

Requirements

  • Node.js: >= 14.0.0
  • MySQL: 5.7+ (recommended 8.0+)
  • PostgreSQL: 12+ (recommended 13+)

Supported Versions

| Database | Minimum | Recommended | |----------|---------|-------------| | MySQL | 5.7 | 8.0+ | | PostgreSQL | 12 | 13+ | | Node.js | 14.0.0 | 16+ |

License

MIT

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details.

Support

For bugs and feature requests, please create an issue on GitHub.

Changelog

See CHANGELOG.md for version history.

Status

Current Version: 0.1.0-beta Development Status: Active development Stability: Beta - Core features functional, testing in progress