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

codemirror-lang-partiql

v0.1.1

Published

PartiQL language support for CodeMirror 6 — DynamoDB-dialect syntax highlighting, linting with quick fixes, and hover tooltips.

Readme

codemirror-lang-partiql

PartiQL language support for CodeMirror 6, targeting the DynamoDB dialect: syntax highlighting, a linter that knows what DynamoDB rejects, quick fixes, and hover tooltips.

Parsing and diagnostics come from dynamodb-partiql-parser; this package is the CodeMirror wiring. It's extracted from the PartiQL editor in DynoTable, where it lints on every keystroke.

Install

npm install codemirror-lang-partiql

Usage

import {EditorView} from '@codemirror/view';
import {partiql, partiqlLinter, partiqlHoverTooltip} from 'codemirror-lang-partiql';

new EditorView({
  doc: 'SELECT * FROM "Orders" WHERE OrderID = 100',
  extensions: [partiql(), partiqlLinter(), partiqlHoverTooltip()],
  parent: document.querySelector('#editor')!
});

Type SELECT * FROM t GROUP BY x and the linter underlines it with "GROUP BY is not supported by DynamoDB PartiQL.". Constructs with a known rewrite (IN (...), LIKE, IS NULL) get a quick-fix action in the diagnostic panel.

API

| Export | What it does | | --- | --- | | partiql() | LanguageSupport: highlighting and keyword completion for the DynamoDB PartiQL keyword set. | | partiqlLinter() | The DynamoDB-dialect linter as an extension, debounced at 500ms, with quick-fix actions. | | partiqlHoverTooltip(options?) | Hover docs for PartiQL functions; pass getFieldInfo to also show your schema's field types on hover. | | lintPartiQL(text) | The linter as a function. Returns CodeMirror Diagnostic[]. | | hasPartiQLErrors(text) | True when any diagnostic is error severity. | | canAutoExecutePartiQL(text) | True for a clean read statement. Gate auto-run shortcuts on this so a write never fires silently. | | PARTIQL_KEYWORDS, PARTIQL_FUNCTIONS, PARTIQL_OPERATORS | The DynamoDB dialect sets, exported as data. |

Schema-aware hover

The editor this came from resolves attribute paths against a local index of the connected table. That dependency is inverted here: hand partiqlHoverTooltip an async resolver and it renders whatever your app knows about a field.

partiqlHoverTooltip({
  getFieldInfo: async (path) => {
    const field = mySchema.lookup(path);
    return field ? {path, dataType: field.type, occurrenceCount: field.count} : null;
  }
});

Without options, hover still documents the built-in functions (begins_with, attribute_exists, contains, ...).

Why the linter matters

DynamoDB accepts a narrow PartiQL subset and rejects everything else at request time. An editor that only highlights SQL keywords lets you type SELECT COUNT(*) FROM t GROUP BY x and find out from a ValidationException. This linter reports the rejection while you type, with the DynamoDB-idiomatic replacement where one exists. The rule set and its fixture corpus live in the parser package.

Related

License

MIT © DynoTable