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

caql

v0.2.0

Published

Calypso Query Language

Downloads

23

Readme

Calypso Query Language (CaQL)

  • Use a SQL-like query language over any queryable data store.
  • Parser & AST provided.
  • Used by calypso and other projects.

Install

npm install caql

Calypso Query Language Specification

The Calypso Query Language (CaQL) has support for field selection, field aliases, filters, and ordering.

Field Selection

select (optional)

select [fields | *]

Select is optional. If not provided, drivers should treat it as an unbounded field selection ('*').

fields

Fields can contain letters, numbers, underscores, and hyphens.

Deep field selections are allowed.

Example: select client.address.street1

Fields can be escaped using brackets as delimiters.

Example: select [date of birth], age, name

aliases

Fields can also be aliased.

Example: select title as t, author as a

Filter Expressions

where

Starts a filter.

Example: select title where author="Kurt Vonnegut"

comparisons

CaQL supports the following comparison expressions:

Equality: select * where name = "Kevin"

Inequality: select * where name != "Rose"

Greater than: select * where age > 30

Greater than or equal to: select * where age >= 30

Less than: select * where price < 10

Less than or equal to: select * where price <= 10

To negate comparisons, use NOT: select * where not age > 30

missing

Use CaQL to discover whether an object has a property.

Undefined value: select * where price is missing

Defined value: select * where price is not missing

contains

select * where name contains "Kevin"

like

select * where name like "%evi%"

The percent symbol (%) acts as a wildcard character matching zero or more characters.

The like operator can be negated with not like.

select * where name not like "%evi%"

location

The location expression supports a distance along with a latitude, longitude pair.

Example: select * where location within 30 of 90.2342, 30.23432

Note: Not all drivers may support this option.

conjunctions

CaQL has support for conjunctions using the keyword and.

Example: select * where name="Kevin" and age=31

disjunctions

CaQL has support for disjunctions, as well, using or.

Example: select * where name="Kevin" or name="Matt"

Sorting

order by

Results can be sorted. A direction can be added. Ascending (asc) is used by default. Descending (desc) must be explicit.

Example: select name, age order by age desc, name asc

License

MIT