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

langium-sql

v0.3.2

Published

Extensible language server for SQL

Downloads

1,884

Readme

Langium/SQL

This project provides a language server for SQL dialects.

Features

  • Schema-driven: Add a set of table definitions to spread out the world for your SELECT queries. The table definitions can be located in a different file of the same workspace. You can keep definitions and queries separated.
  • Code completion: Press Ctrl + Space keys to trigger the completion directly. You will get suggestions for the current context.
  • Syntax highlighting: to distinguish what are keywords, identifiers, numeric literals and for a better perception of the SQL syntax.
  • Symbol search: Use Cmd or Ctrl + mouse click on a column name to find the definition of it or explore the places where a column is used.
  • Fast feedback about contextual correctness: Whether referenced columns exist or types on certain operators are matching.
  • Super-set approach: Any piece of any dialect that is missing can be added to the main grammar and be protected from other dialects using validations.
  • Highly customizable: Any behavior or aspect that is missing for your specific use case can be easily overwritten.

Demo

We prepared a showcase on the Langium project website. You can find it here.

The given schema describes an airport database. It contains tables for airports, airlines, flights, and passengers. The queries are written in the MySQL dialect.

Getting started

Installation

npm install langium-sql

or

yarn add langium-sql

Example usage

Here is a minimal example of how to use the Langium/SQL language server in your project.

import { parseHelper, createTestServices } from "../test-utils";
import { join } from "path";
import { MySqlDialectTypes } from "../../src/dialects/mysql/data-types";

const services = createTestServices(MySqlDialectTypes);
const parse = await parseHelper(services.Sql, join('path', 'to', 'schemas.sql'));
const document = await parse("SELECT * FROM my_table;");

console.log(document.parseResult.value);

See more examples in the Langium test folder.

Learn more

Look at the announcing blog post or the Langium documentation to get familiar with the project structure.

License

MIT