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

@elyracode/db-tools

v0.7.9

Published

Database tools for Elyra - query MySQL and ClickHouse with schema awareness and safety guardrails

Readme

@elyracode/db-tools

Database tools for Elyra -- query MySQL and ClickHouse with schema awareness and safety guardrails.

Install

elyra install npm:@elyracode/db-tools

Configuration

Automatic: .env file (recommended)

If your project has a .env file (e.g. Laravel), db-tools reads it automatically. Standard key names are mapped:

| .env key | Maps to | Used by | |----------|---------|--------| | DB_HOST | ELYRA_MYSQL_HOST | MySQL | | DB_PORT | ELYRA_MYSQL_PORT | MySQL | | DB_DATABASE | ELYRA_MYSQL_DATABASE | MySQL | | DB_USERNAME | ELYRA_MYSQL_USER | MySQL | | DB_PASSWORD | ELYRA_MYSQL_PASSWORD | MySQL | | CLICKHOUSE_HOST | ELYRA_CLICKHOUSE_HOST | ClickHouse | | CLICKHOUSE_PORT | ELYRA_CLICKHOUSE_PORT | ClickHouse | | CLICKHOUSE_DATABASE | ELYRA_CLICKHOUSE_DATABASE | ClickHouse | | CLICKHOUSE_USERNAME | ELYRA_CLICKHOUSE_USERNAME | ClickHouse | | CLICKHOUSE_PASSWORD | ELYRA_CLICKHOUSE_PASSWORD | ClickHouse | | CLICKHOUSE_HTTPS | ELYRA_CLICKHOUSE_HTTPS | ClickHouse | | CLICKHOUSE_TIMEOUT_CONNECT | ELYRA_CLICKHOUSE_TIMEOUT_CONNECT | ClickHouse | | CLICKHOUSE_TIMEOUT_QUERY | ELYRA_CLICKHOUSE_TIMEOUT_QUERY | ClickHouse |

For a typical Laravel project, your existing .env already has DB_HOST, DB_DATABASE, etc. -- db-tools picks them up with zero configuration.

Manual: environment variables

You can also set ELYRA_* env vars directly. These always take precedence over .env values.

# MySQL
export ELYRA_MYSQL_HOST=localhost
export ELYRA_MYSQL_PORT=3306
export ELYRA_MYSQL_USER=readonly_user
export ELYRA_MYSQL_PASSWORD=secret
export ELYRA_MYSQL_DATABASE=myapp

# ClickHouse
export ELYRA_CLICKHOUSE_HOST=localhost
export ELYRA_CLICKHOUSE_PORT=8123
export ELYRA_CLICKHOUSE_DATABASE=mydb
export ELYRA_CLICKHOUSE_USERNAME=default
export ELYRA_CLICKHOUSE_PASSWORD=secret
export ELYRA_CLICKHOUSE_HTTPS=false
export ELYRA_CLICKHOUSE_TIMEOUT_CONNECT=10000
export ELYRA_CLICKHOUSE_TIMEOUT_QUERY=30000

Tools

| Tool | Description | |------|-------------| | query_mysql | Execute SQL against MySQL. Results returned as JSON. | | query_clickhouse | Execute SQL against ClickHouse. Optimized for analytical queries on large datasets. | | query_sqlite | Execute SQL against SQLite. Auto-detects Laravel SQLite databases from .env. | | get_database_schema | Discover tables, columns, types, and indexes. Supports MySQL, ClickHouse, and SQLite. |

SQLite

SQLite is auto-detected from your project:

  1. If .env has DB_CONNECTION=sqlite, uses DB_DATABASE path
  2. Falls back to database/database.sqlite (Laravel default)
  3. Or pass an explicit path: the agent uses db_path parameter

No configuration needed for most Laravel projects.

Security

  • Read-only by default: Only SELECT, SHOW, DESCRIBE, and EXPLAIN queries are allowed.
  • Write access: Set ELYRA_DB_ALLOW_WRITES=true to enable INSERT, UPDATE, DELETE.
  • Recommendation: Use a database user with minimal privileges (SELECT only).

Usage

Once installed, just ask Elyra about your data:

> How many users registered this week?
> Show me the top 10 products by revenue
> What's the average response time from the logs table?
> Describe the schema of the orders table

The agent will automatically use get_database_schema to understand your database structure, then write and execute the appropriate SQL.