Skip to content

Point the SQLBuild rule example at its column - #26

Merged
kvlonge merged 1 commit into
mainfrom
docs/sqlbuild-rule-column
Nov 30, 2026
Merged

kvlonge merged 1 commit into
mainfrom
docs/sqlbuild-rule-column

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Why

The SQLBuild card's compile error wrapped its 119-character source line, and the caret sat at column 1, so it was hard to see what the rule pointed at.

Changes

  • The rule computes the column of __source( and passes it to ctx.finding, so the caret sits under it.
  • The example model's join puts the @enum filter on the JOIN line and the key match on the next, so the reported line (85 characters) fits on desktop.
  • The output is a real sqb compile run (sqlbuild 0.274.0) of that rule and model.

Verification

  • npx playwright test (6 passed).
  • Rendered the card at 1440px in light and dark and at 390px.

The custom rule now reports the column of __source( as well as its line,
so the caret in the compile error sits under it. The model's join line is
shorter, so the error fits on one line on desktop while still showing the
@enum.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sqlstack with  Cloudflare Pages  Cloudflare Pages

Latest commit: 18154ea
Status: ✅  Deploy successful!
Preview URL: https://1639c1ed.sqlstack.pages.dev
Branch Preview URL: https://docs-sqlbuild-rule-column.sqlstack.pages.dev

View logs

@kvlonge
kvlonge merged commit 45a517d into main Nov 30, 2026
4 checks passed
@kvlonge
kvlonge deleted the docs/sqlbuild-rule-column branch November 30, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant