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

flyql

v1.0.0

Published

A lightweight, injection-proof query language for multi-dialect SQL generation

Readme

flyql

A lightweight, injection-proof query language that parses human-readable filter expressions into a portable AST, transpiles to SQL across ClickHouse, PostgreSQL, and StarRocks, and evaluates in-memory.

Installation

npm install flyql
# or
pnpm add flyql

Requires Node.js 16+.

Quick Start

Parse a query

import { parse } from 'flyql'

const result = parse("status = 200 and active")
console.log(result.root)

Generate SQL

import { parse } from 'flyql'
import { generateWhere, newColumn } from 'flyql/generators/clickhouse'

const result = parse("status >= 400 and host like 'prod%'")

const columns = {
    status: newColumn({ name: 'status', type: 'UInt32' }),
    host: newColumn({ name: 'host', type: 'String' }),
}

const sql = generateWhere(result.root, columns)
console.log(sql)

Generators are available for ClickHouse, PostgreSQL, and StarRocks:

import { generateWhere, newColumn } from 'flyql/generators/clickhouse'
import { generateWhere, newColumn } from 'flyql/generators/postgresql'
import { generateWhere, newColumn } from 'flyql/generators/starrocks'

Match in-memory data

import { match } from 'flyql/matcher'

const data = {
    status: 200,
    active: true,
    host: "prod-api-01",
}

const matches = match("status = 200 and active", data)
console.log(`Matches: ${matches}`) // true

Transformers

import { parse } from 'flyql'
import { generateWhere, newColumn } from 'flyql/generators/clickhouse'

const result = parse("message|upper = 'ERROR'")

const columns = { message: newColumn({ name: 'message', type: 'String' }) }
const sql = generateWhere(result.root, columns)
console.log(sql) // equals(upper(message), 'ERROR')

Column parsing

import { parse, parseToJson } from 'flyql/columns'

const parsed = parse("message, status")
for (const col of parsed) {
    console.log(`${col.name} (display: ${JSON.stringify(col.displayName)}, segments: ${col.segments})`)
}

// Enable transformers
const withTransforms = parse("message|chars(25) as msg, status", { transformers: true })

// Serialize to JSON
const json = parseToJson("message, status|upper", { transformers: true })
console.log(json)

The Vue 3 editor ships as a separate package: flyql-vue. See docs.flyql.dev for details.

Package Exports

| Import path | Description | |---|---| | flyql | Core parser, AST types, transformers | | flyql/core | Parser and AST types only | | flyql/matcher | In-memory query evaluation | | flyql/columns | Column expression parsing | | flyql/transformers | Transformer registry | | flyql/generators/clickhouse | ClickHouse SQL generation | | flyql/generators/postgresql | PostgreSQL SQL generation | | flyql/generators/starrocks | StarRocks SQL generation | | flyql/highlight | Syntax highlighting |

Links

License

MIT