Skip to main content
Version: 0.4.10

JS Implementation

The JS implementation of MistQL can be installed via npm install mistql.

Example Usage:#

import {query} from 'mistql';
const len = query('count @', [1, 2, 3]);console.log(len);

mistql package exports#

ExporttypeDescription
query(query: string, data: any) => anyThe query interface for MistQL
default{query: query}An object solely consisting of the query interface

Type correspondence between JS and MistQL#

Separate from the specification of the language, the JS implementation maps from JS types to MistQL types in a specific manner, as documented by the table below. As the following is NOT part of the language, rather the library, the correspondence may change with further releases of the mistql package, following semver.

If this correspondence doesn't work for you for some reason, please open an issue and describe the situation carefully. This correspondence is easier to change than the language itself.

ValueMistQL ValueNotes
numbernumberInfinity and NaN casted to null
booleanboolean
stringstring
objectobject
nullnull
arrayarray
undefinednull
functionobject with enumerated properties
Number objectnumber
Boolean objectboolean
String objectstring
Datedate.toISOString()
Symbolsymbol.toString()
Anything elseobject with enumerated properties