Skip to content

Commit c6c6e0f

Browse files
Edit/cleanup recent docs changes (#292)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1af43a6 commit c6c6e0f

13 files changed

Lines changed: 27 additions & 27 deletions

File tree

src/blog/2026-01-13-context-md-convention/index.malloynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This is based on our experience. We're sharing it to start a conversation. We ho
1010

1111
## The Malloy Experience
1212

13-
Starting from zero experience with LLMs we discovered that if you fill a conversation context with all information about the Malloy repository, the result is a context with very little room for exploration and problem solving. In our experience, the results of LLM assisted coding are much better when carefully feeding the LLM a context focused on the problem at hand. Over time we found there were particular areas of the code where it made sense to gather the information the LLM gleaned, and some guidance from a human who is very familiar with the code, into a context-unit which would be re-usable and shareable.
13+
Starting from zero experience with LLMs, we discovered that filling a conversation context with all information about the Malloy repository leaves very little room for exploration and problem solving. Results are much better when you carefully feed the LLM context focused on the problem at hand. Over time, we found it made sense to gather the information the LLM gleaned — along with guidance from a human familiar with the codeinto reusable, shareable context units.
1414

1515
As we review pull requests, we continue to update our contexts, and this is gradually making pull request reviews cleaner. If our scheme of `CONTEXT.md` maintenance were generally known and recognized by the LLMs used by contributors, it would make it easier for external contributors to make solid contributions to our repository.
1616

@@ -22,11 +22,11 @@ We distribute `CONTEXT.md` files throughout the repository tree. Each file descr
2222

2323
- Our main repository is a monorepo, with multiple sub-components (Compiler, Renderer, API, etc.) so
2424
a single context file doesn't make sense for these individual components.
25-
- Keeps individual context files smaller, allows an LLM assisted activity to read the appropriate context
25+
- Keeps individual context files smaller. Allows an LLM-assisted activity to read the appropriate context
2626
to finish a task without reading all documentation for the project. Scales well to larger projects.
2727
- Keeps the naming/location of these files LLM-agnostic
2828
- Humans and LLMs are always pair programming, so both humans and LLMs need to be able to
29-
both review code changes, and update and maintain context files for the code.
29+
review code changes and update and maintain context files for the code.
3030

3131
In our repository it looks something like this:
3232

src/blog/2026-02-25-persistence/index.malloynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The `#@ persist` annotation is metadata, not a language keyword. It lives in Mal
4343

4444
### Inheritance
4545

46-
Persistence flows through `extend`. If the base data is worth persisting, derived versions usually are too:
46+
Persistence flows through `extend`. When you extend a persistent source, the extension reads from the same pre-built table — it just adds computed fields on top:
4747

4848
```malloy
4949
#@ persist name=by_carrier
@@ -52,12 +52,12 @@ source: by_carrier is flights -> {
5252
aggregate: flight_count is count()
5353
}
5454

55-
// Also persistent — inherits from by_carrier
55+
// Reads from the pre-built by_carrier table, adds a computed field
5656
source: enriched is by_carrier extend {
5757
dimension: upper_carrier is upper(carrier)
5858
}
5959

60-
// Break the chain when you need to
60+
// Opt out: recomputes the query instead of using the pre-built table
6161
#@ -persist
6262
source: scratch is by_carrier extend { ... }
6363
```
@@ -116,7 +116,7 @@ To verify it's working, compile a query without running it and check the SQL. Yo
116116

117117
Many connections work with no configuration at all — if a connection name matches a registered database type, Malloy creates one with default settings. For persistence, the main thing you need to decide is where the manifest lives:
118118

119-
- **Global config** (simplest): The CLI reads `~/.config/malloy/malloy-config.json` by default and writes the manifest next to it. Point VS Code's `malloy.globalConfigDirectory` at the same directory, and both tools share the same manifest. No flags needed.
119+
- **Global config** (simplest): The CLI reads `~/.config/malloy/malloy-config.json` by default and writes the manifest next to it. Point VS Code's `malloy.globalConfigDirectory` at the same directory, and both tools share the same manifest. No flags needed. If you're just getting started, this is the easiest path.
120120

121121
- **Project config**: Put a `malloy-config.json` in your project root (it can be as minimal as `{}`) to anchor the manifest to your project. VS Code finds it automatically; the CLI needs `--config .`.
122122

@@ -144,7 +144,7 @@ Because the manifest is optional, persistence supports very different experience
144144

145145
**Partial manifest (incremental builds):** Some sources are pre-built, others expand inline. The compiler doesn't care which sources are in the manifest and which aren't. This lets a builder do incremental work — build what's missing, skip what's fresh.
146146

147-
**Full manifest with `strict` mode (production):** When a manifest has `strict: true`, the compiler fails if any persistent source is *missing* from the manifest. This catches configuration errors — if a table should have been built but wasn't, you find out at compile time rather than by accidentally running an expensive query in production. The builder sets `strict` in the manifest file; an application can override it with `manifest.strict = false` if needed.
147+
**Full manifest with `strict` mode (production):** When a manifest has `strict: true`, the compiler fails if any persistent source is *missing* from the manifest. This catches configuration errors — if a table should have been built but wasn't, you find out at compile time rather than by accidentally running an expensive query in production. The builder sets `strict` in the manifest file; an application using the API can override this programmatically if needed.
148148

149149
## Building a Sophisticated Persistence Application
150150

src/documentation/experiments/experiments.malloynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
>>>markdown
22
# Experimental Features
33

4-
Before releasing language features, we like to get a feel for how they work when used in programs. We often find bugs or language problems. We like when people use these features with the understanding that they might changed in their final form or never be released.
4+
Before releasing language features, we like to get a feel for how they work when used in programs. We often find bugs or language problems. We like when people use these features with the understanding that they might change in their final form or never be released.
55

66
We value feedback during the experimental phase. Please make sure you let us know what you think.
77

8-
Below is a list of currently running experiements and how to turn them on.
8+
Below is a list of currently running experiments and how to turn them on.
99

1010
* `##! experimental.join_types` - [Additional Join Type](joins.malloynb)
1111
* `## renderer_next` - [New table and visualization Rendering](renderer.malloynb)

src/documentation/experiments/persistence.malloynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ source: by_origin is flights -> {
3535
}
3636
```
3737

38-
Persistence is inherited when you `extend` a persistent source. The child keeps the same table name unless you override it. Use `#@ -persist` to opt out:
38+
When you `extend` a persistent source, the extension still reads from the same pre-built table — the extension just adds computed fields on top. Use `#@ -persist` to opt out and force the underlying query to be recomputed instead:
3939

4040
```malloy
41-
// Inherits persistence from by_carrier
41+
// Reads from the pre-built by_carrier table, adds a computed field
4242
source: enriched is by_carrier extend {
4343
dimension: upper_carrier is upper(carrier)
4444
}
4545

46-
// Opt out of persistence
46+
// Opt out: recomputes the query instead of using the pre-built table
4747
#@ -persist
4848
source: temporary is by_carrier extend { ... }
4949
```
@@ -91,7 +91,7 @@ malloy-cli --config . build models/
9191

9292
### Building
9393

94-
The builder compiles `.malloy` files, finds `#@ persist` sources, and creates the database tables:
94+
The builder compiles `.malloy` files (or all files in a directory), finds `#@ persist` sources, and creates the database tables:
9595

9696
```bash
9797
# Build all .malloy files in the current directory (recursive)
@@ -159,7 +159,7 @@ If VS Code and the builder are reading different config files, they'll have diff
159159

160160
By default, if a `#@ persist` source is missing from the manifest (e.g., it hasn't been built yet), queries fall through to computing the result inline — the same as if no manifest existed. This is convenient during development but risky in production, where an unbuilt table might mean an unexpectedly expensive query.
161161

162-
The builder creates manifests with `strict` mode enabled. When strict mode is on, a missing manifest entry for a `#@ persist` source causes an error instead of falling through. This catches configuration problems early — if a table should have been built but wasn't, you find out at compile time.
162+
The builder creates manifests with `strict` mode enabled by default. When strict mode is on, a missing manifest entry for a `#@ persist` source causes an error instead of falling through. This catches configuration problems early — if a table should have been built but wasn't, you find out at compile time.
163163

164164
If you need to disable strict mode (e.g., during development when only some tables are built), you can edit `malloy-manifest.json` and set `"strict": false`. The builder will not overwrite this setting on subsequent builds.
165165
>>>markdown

src/documentation/language/connections.malloynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ There are currently two connection methods, `.table()` and `.sql()`.
1717

1818
## Table Connection Method
1919

20-
The `.table()` connection method is used to reference a table or view in a database. It accepts a single string representing a table. The exact semantics of how that string is resolved into a table schema depend on the database and application.
20+
The `.table()` connection method is used to reference a table or view in a database. It accepts a single string representing a table. The exact semantics of how that string is resolved depend on the database and application.
2121

2222
In the official Malloy connection implementations, the behavior is as follows:
2323

@@ -31,7 +31,7 @@ In Databricks, the string passed to the `.table()` connection method can be a on
3131

3232
### DuckDB
3333

34-
In DuckDB, the `.table()` method accepts the path (relative to the Malloy file) of CSV, JSON, or Parquet file containing the table data, e.g. `duckdb.table('data/users.csv')` or `duckdb.table('../../users.parquet')`. URLs to such files (or APIs) are also allowed: see [an example here](../patterns/apijson.malloynb).
34+
In DuckDB, the `.table()` method accepts the path (relative to the Malloy file) of a CSV, JSON, or Parquet file containing the table data, e.g. `duckdb.table('data/users.csv')` or `duckdb.table('../../users.parquet')`. URLs to such files (or APIs) are also allowed: see [an example here](../patterns/apijson.malloynb).
3535

3636
### Postgres
3737

src/documentation/language/dialect/databricks.malloynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ source: orders is databricks.table('my_catalog.analytics.orders')
4444

4545
## Limitations
4646

47-
- **`string_agg` ordering**: Databricks does not support `ORDER BY` inside `COLLECT_LIST`/`COLLECT_SET`, so `string_agg` and `string_agg_distinct` do not support the `order_by` modifier.
47+
- **`string_agg` ordering**: Databricks does not support ordering within aggregate collection functions, so `string_agg` and `string_agg_distinct` do not support the `order_by` modifier.
4848
- **`TIMESTAMP_NTZ`**: Databricks' `TIMESTAMP_NTZ` (timestamp without timezone) maps to `sql native` in Malloy. Use explicit casting to `timestamp` when needed.
4949

5050
# Functions

src/documentation/language/dialect/mssql-via-duckdb.malloynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ and `setupSQL` ATTACHes to your SQL Server and sets the default catalog and sche
3434
```
3535

3636
The `setupSQL` runs once per session. The `USE` must include both catalog and
37-
schema (e.g., `mydb.dbo`) `USE mydb` alone is not sufficient.
37+
schema (e.g., `mydb.dbo`) so that DuckDB can resolve unqualified table names. `USE mydb` alone sets only the catalog, leaving the schema ambiguous.
3838

3939
See [Configuration](../../setup/config.malloynb) for more details on `malloy-config.json`.
4040

src/documentation/malloy_cli/index.malloynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
>>>markdown
22
# About the Malloy CLI
33

4-
The [Malloy CLI](https://github.com/malloydata/malloy-cli) is a command-line interface for running `.malloysql` and `.malloy` files. It can be used to automate transformations, build simple pipelines, or even integrate compiled Malloy SQL into other applications.
4+
The [Malloy CLI](https://github.com/malloydata/malloy-cli) is a command-line interface for running `.malloysql` and `.malloy` files and building persistent tables. It can be used to automate transformations, build simple pipelines, or even integrate compiled Malloy SQL into other applications.
55

66
## Installation
77

@@ -25,7 +25,7 @@ If a connection name in your model matches a registered database type (DuckDB, B
2525

2626
## Usage
2727

28-
The main commands of the CLI are `run` and `compile` — `run` executes queries and returns results, whereas `compile` returns SQL for a query or many queries.
28+
The main commands of the CLI are `run`, `compile`, and `build` — `run` executes queries and returns results, `compile` returns SQL for a query or many queries, and `build` creates persistent tables from `#@ persist` sources.
2929

3030
The CLI has detailed usage information for each command. You can get general help with `malloy-cli --help`, and command-specific help and options with `malloy-cli {command} --help`
3131

src/documentation/setup/cli.malloynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
>>>markdown
2-
# Installing the CLI
2+
# CLI Setup
33

44
The [Malloy CLI](https://github.com/malloydata/malloy-cli) is a command-line interface for running `.malloysql` and `.malloy` files. Use it to automate transformations, build pipelines, or compile Malloy queries to SQL.
55

src/documentation/setup/config.malloynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ All connection types support a `setupSQL` parameter. This is a multi-line text f
146146

147147
Each statement must end with `;` at the end of a line. Statements can span multiple lines. Only one statement-ending `;` is allowed per line.
148148

149-
**Legal** — each statement ends with `;` on its own line:
149+
**Correct** — each statement ends with `;` on its own line:
150150
```
151151
SET search_path TO analytics;
152152
CREATE TEMP TABLE foo
153153
AS SELECT 1;
154154
```
155155

156-
**Illegal** — two statements on the same line:
156+
**Incorrect** — two statements on the same line:
157157
```
158158
SET search_path TO analytics; CREATE TEMP TABLE foo AS SELECT 1;
159159
```

0 commit comments

Comments
 (0)