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 🙏

© 2024 – Pkg Stats / Ryan Hefner

desql

v0.3.0

Published

An SQL parser

Downloads

1

Readme

𓃕DeSQL SQL Parser

Table of Contents generated with DocToc

𓃕DeSQL SQL Parser

🚧 Work in progress 🚧

Goal

Provide a tool that can deliver an in-depth analysis of a given set of SQL statements—be it Data Definition, Query or Manipulation Language (DDL, DQL, DML)—that can then be utilized to catalog and visualize which parts (fields) of which relations (tables, views) are referenced by which other relations. Such visualizations could take on the shape of an ER diagram, a connection matrix or other novel ways.

2022-02-11T21:20:17+01:00

𓃕DeSQL now parses big parts of SQL sources and identifies its 'parts of speech'. We assemble a list of nodes of the AST in table raw_nodes. From the position information given for the terminal nodes we can infer what text has been matched. Furthermore we keep both track of what parent each node has as well as a 'path' of the (abbreviated) type names of all ancestors:

Given this data, we can color code a given SQL source to indicate what parts have been matched by which productions, allowing to differentiate between real and aliased names for columns and tables:

At present the parser will skip all whitespace and comments, stop parsing when encountering constructions deemed ungrammatical, and parse only a single query. All these shortcomings will be addressed:

To Do

  • [+] add location information
  • [–] fix (many) faulty location data (stop equals or precedes start line, column NR)
  • [–] parse multiple statements
  • [–] at present, comments and stuff the parser doesn't understand are left out of the result which constitues silent failure; ensure 100% source code coverage (whitespace may be left out, but not comments and also not unsyntactic garbage)
  • [–] fix line, column numbers for coverage misses (whitespace and material stretches)