open-index/open-npm huggingface dataset:
npm package: @malloydata/db-bigquery
Description: Malloy is a modern open source language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy currently connects to BigQuery and Postg
Latest version: 0.0.374

# Malloy

Malloy is a modern open source language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy currently connects to BigQuery and Postgres, and natively supports DuckDB. We've built a Visual Studio Code extension to facilitate building Malloy data models, querying and transforming data, and creating simple visualizations and dashboards.

## This package

This package facilitates using the `malloydata/malloy` library with BigQuery - see [here](https://github.com/malloydata/malloy/blob/main/packages/malloy/README.md) for additional information.
npm package: @malloydata/db-duckdb
Description: Malloy is a modern open source language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy currently connects to BigQuery and Postg
Latest version: 0.0.374

# Malloy

Malloy is a modern open source language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy currently connects to BigQuery and Postgres, and natively supports DuckDB. We've built a Visual Studio Code extension to facilitate building Malloy data models, querying and transforming data, and creating simple visualizations and dashboards.

## This package

This package facilitates using the `malloydata/malloy` library with DuckDB - see [here](https://github.com/malloydata/malloy/blob/main/packages/malloy/README.md) for additional information.
npm package: @malloydata/db-postgres
Description: Malloy is a modern open source language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy currently connects to BigQuery and Postg
Latest version: 0.0.374

# Malloy

Malloy is a modern open source language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy currently connects to BigQuery and Postgres, and natively supports DuckDB. We've built a Visual Studio Code extension to facilitate building Malloy data models, querying and transforming data, and creating simple visualizations and dashboards.

## This package

This package facilitates using the `malloydata/malloy` library with Postgres - see [here](https://github.com/malloydata/malloy/blob/main/packages/malloy/README.md) for additional information.
npm package: @malloydata/db-trino
Description: Malloy is a modern open source language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy currently connects to BigQuery and Postg
Latest version: 0.0.374

# Malloy

Malloy is a modern open source language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy currently connects to BigQuery and Postgres, and natively supports DuckDB. We've built a Visual Studio Code extension to facilitate building Malloy data models, querying and transforming data, and creating simple visualizations and dashboards.

## This package

This package facilitates using the `malloydata/malloy` library with Trino - see [here](https://github.com/malloydata/malloy/blob/main/packages/malloy/README.md) for additional information.
npm package: @malloydata/malloy-explorer
Description: Malloy visual query builder
Author: scullin@meta.com
Latest version: 0.0.338-dev260215172810

# Development directions

- Initialize git sub-modules

```
git submodule init
git submodule update
```

- Install required packages

```
npm install
```

- To test, run the vite developer tool

```
npm run dev
```

- Open http://localhost:5173/

## Running against a local version of Malloy

1. Run `npm run malloy-build-and-link` once and whenever you need to pull in changes
2. If you need to pull in changes of `@malloydata/malloy-render`, then navigate to the `malloy` direcory and build it using `npm run build` first.
3. If you make changes to Malloy that are required by the explorer, then merge those into main, and that will trigger an automatic developer release of Malloy.
4. Once that release completes, run `npm run malloy-update` to update dependencies to that release. This will break the link to your local version of Malloy, so if you want to resume local development, re-run `npm run malloy-link`
5. To manually unlink without updating, you may run `npm run malloy-unlink`
npm package: @malloydata/malloy-filter
Description: Parsers for the Malloy filtering sub-languages
Latest version: 0.0.374

# Filter Languages

There is a unique filter language for each filterable data type. The documentation-bRoKeN-lInK describes the various languages.

# Grammars

`malloy-filter` uses [peggy](https://peggyjs.org/) to generate parsers for each sub language. The grammars are in `src/grammars/`.

After changing a `.peggy` file use `npm run build` to update the generated parser.

# API

Refer to the [clause interfaces](src/filter_clause.ts) for details on the
output of the parser, or look at the parser tests in [`src/test/`](src/test/) for more examples
of parser output.

```TypeScript
import {StringFilterExpression, StringClause} from '@malloydata/malloy-filter'

// or ...
// NumberFilterExpression, NumberClause
// BooleanFilterExpression, BooleanClause
// TemporalFilterExpression, TemporalClause

// Each has two entry points, "parse" and "unparse"

const stringParse = StringFilterExpression.parse('FOO%,-FOOD')
if (stringParse.parsed) {
    console.log(JSON.stringify(stringParse.parsed, null, 2));
    /*
     * Output will look something like this ...
     * { operator: ',',
     *   members: [
     *     {operator: 'starts', values: ['FOO']}
     *     {operator: '=', not: true, values: ['FOOD']}
     *   ],
     * }
     */
    console.log(StringFilterExpression.unparse(stringParse.parse));
    /*
     * There will be minor variations on unparse, for example in this
     * case there will be space after the comma:
     *
     * FOO%, -FOOD
     */
} else {
    console.log(stringParse.log);
}
```

# Testing

The `malloy-filter` tests use Jest.

```bash
npm run build
npm run test
```
npm package: @malloydata/malloy-profiler
Description: This package enables profiling of the Malloy compiler. Currently it only works with stateless compilation of queries. In the future we can extend it to support other kinds of compilation.
Latest version: 0.0.374

# Malloy Stable Request Profiler

This package enables profiling of the Malloy compiler. Currently it only works with stateless compilation of queries. In the future we can extend it to support other kinds of compilation.

## Usage

### Basic timing (100 iterations with average):
```bash
npm run time path/to/file.json
```

### Detailed flame graph profiling:
```bash
npm run profile path/to/file.json
```

This creates a `.cpuprofile` file and provides instructions for viewing the flame graph in Chrome DevTools.

To view the flame graph:
1. Open Chrome and navigate to `chrome://inspect`
2. Click "Open dedicated DevTools for Node"
3. Go to the Performance tab
4. Load the generated `.cpuprofile` file
npm package: @malloydata/render
Description: The Malloy Renderer is a web component for rendering Malloy query results. It is included by default in the Malloy VSCode extension, but can also be embedded by developers into their own applications that use Malloy query results. To learn more about how 
Latest version: 0.0.374

# Malloy Renderer

The Malloy Renderer is a web component for rendering Malloy query results. It is included by default in the Malloy VSCode extension, but can also be embedded by developers into their own applications that use Malloy query results. To learn more about how to use the renderer in a Malloy model, see [the Renderer docs](https://docs.malloydata.dev/documentation/visualizations/overview).

## Using the Renderer in Web Apps

1. Install the renderer package

```bash
$ npm i @malloydata/render
```

2. Import the web component somewhere in your project. This will automatically register the `<malloy-render>` web component on your document.

```javascript
import '@malloydata/render/webcomponent';
```

3. Use the web component in your app by creating a `<malloy-render>` node and passing it Malloy query results:

```javascript
const malloyRenderElement = document.createElement('malloy-render');
// Pass a Malloy Result object to the renderer
malloyRenderElement.result = myMalloyResult;

/*
Alternatively, you can pass Malloy QueryResult and ModelDef objects to the renderer,
which will then construct the Result object. This is useful when you are receiving serialiazed Malloy results via an API.
*/
malloyRenderElement.queryResult = myQueryResult;
malloyRenderElement.modelDef = myModelDef;
```

### Explicitly registering the web component

In some situations, such as using Malloy Render with a mock DOM like JSDOM, you may want to explicitly register the web component on a document. This can be done using the `@malloydata/render/webcomponent/register` import like so:

```javascript
import registerMalloyRender from '@malloydata/malloy-render/webcomponent/register';

const {window} = new JSDOM(`...`);

registerMalloyRender({
  customElements: window.customElements,
  HTMLElement: window.HTMLElement,
});
```

## Plugin System

The Malloy Renderer supports a plugin system for creating custom visualizations. See the plugin documentation:

- [Plugin System Overview](./docs/plugin-system.md) - Comprehensive guide to the plugin architecture
- [Plugin Quick Start](./docs/plugin-quick-start.md) - Get started quickly with minimal examples  
- [Plugin API Reference](./docs/plugin-api-reference.md) - Complete API documentation

# Developing

See the [Developing README](./DEVELOPING.md)
npm package: @malloydata/syntax-highlight
Description: A package to simplify the process of developing, testing, and syncnig Malloy syntax highlighting grammars
Latest version: 0.0.374

# Malloy Syntax Highlighting

Malloy is a modern open source language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy currently supports BigQuery and Postgres, as well as querying Parquet and CSV files via DuckDB.

Currently, two other dialects of Malloy are supported in addition to the standard syntax used in `.malloy` files: the Malloy notebook format (`.malloynb`) and Malloy SQL (`.malloysql`). The purpose of this `npm` package is to mitigate syncing issues across `@malloydata` repositories that depend upon syntax highlight files and to make these assets more easily available for future integrations.

This `npm` package does not include the source files used to develop these syntax highlighting files. If you are interested in using the existing infrastructure to modify, test, or generate these grammar files, please refer to the [malloy monorepo](https://github.com/malloydata/malloy/tree/main/packages/malloy-syntax-highlight) and see `DEVELOPING.md` for steps to do so.