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

qlcodes

v1.1.4

Published

A small utility that unifies SQL error codes (SQLSTATE) from different DBMS into a single, normalized structure through a curated dataset constructed at build time. The module is built from authoritative vendor documentation (IBM, PostgreSQL, Oracle) and

Readme

QLCodes

A small utility that unifies SQL codes describing states (SQLSTATE) from different DBMS into a single, normalized structure through a curated dataset constructed at build time.

The module is built from authoritative vendor documentation (IBM, PostgreSQL, Oracle) and generates static reference data at build time. Find references bellow.

SQLSTATES coverage

The project aims to cover sql states for most of RDBMS drivers supported by Typeorm such as Google Spanner. Find bellow the actual coverage:

🕓 MySQL | 🕓 MariaDB | ✅ PostgreSQL | 🕓 CockroachDB (Postgres-compatible) 🕓 Microsoft SQL Server | ✅ Oracle | 🕓 SQLite | 🕓 SAP HANA | 🕓 Google Spanner | ✅ IBM*

( * ) IBM defines and publishes SQLSTATE codes as part of the SQL standard, so their The codes should covere IBM products such as DB2, IBM Informix, IBM Netezza, IBM i (AS/400) .

Installation

$ npm install qlcodes

Usage

import { lens } from "qlcodes";
    
const state = lens("42501");
    
console.log(state);

Output :

{
  code: "42501",
  keys: [ "insufficient_privilege" ],
  use: [ "ibm", "postgres" ],
  reason: "The authorization ID does not have the privilege to perform the specified operation on the identified object.",
  qlcs: "qlcodes_sucess"
}

Mismatches

If the provided SQLSTATE does not match any known entry, we return a normalized fallback object This guarantees that lens() always returns a predictable object shape.

There are three mismatch levels that we detect.

Format : The provided code is malformed and is not validate the expression /[0-9A-Z]{5}/

ℹ️ "SQLSTATE values are comprised of a two-character class code value, followed by a three-character subclass code value. (ISO/IEC 9075:1992)"

console.log(lens("123456"));

Output:

{
  code: "123456",
  keys: [],
  qlcs: "qlcodes_malformed",
  use: [],
  r

Class : The provided code matches no code class

console.log(lens("ABCDE"));

Output:

{
  code: "ABCDE",
  keys: [],
  qlcs: "qlcodes_no_class_found",
  use: [],
  reason: "The code 'ABCDE' does not match any entries in qlcodes. This may be a qlcode issue only to provide you with the correct information"
}

Code : The provided code matches no code within known classes

console.log(lens("2000U"));

Output:

{
  code: "2000U",
  keys: [],
  qlcs: "qlcodes_no_code_found",
  use: [],
  reason: "The code '2000U' does not match any entries in qlcodes. This may be a qlcode issue only to provide you with the correct information"
}

API

lens(code: string): QLLens

|Parameters|Returns| |-|-| |code SQLSTATE status code | A structured status description| || code — normalized SQLSTATE, or -1 if not found || keys — semantic identifiers || useDBMS where the code is applicable || reason — human-readable explanation || qlcs — 'qlcode status', shows the lens call status

Customization & Rebuild (Contributors)

⚠️ Do not modify files inside node_modules. Changes will be lost on reinstall.

If you want to extend or adjust the reference data:

  1. Clone the repository
$ git clone https://github.com/ManuUseGitHub/QLCodes.git
$ cd qlcodes
$ npm install
  1. Modify files:
  • under references/ -> CSV files generated from vendor documentation
  • under src/ -> transformation and normalization logic

⚠️ follow the data modification pipeline describe by the build.sh script. unless you know what you know what you are doing.

  1. Rebuild the module
$ npm run build

Quality of life

You may pass argument to the build script to enforce a few behaviours to help you seing through the process...

|argument|effect| |-|-| |--debug|prevents the cleanup of middle stage file created during the data processing| |--make-keys|allows the creation of keys when a description is given...through the 'generate' step (generate.cjs)|

Use your customized build via a local dependency or a forked package.


Showcase

in stackblitz


References


License

MIT 2025