Skip to content

JiT SQLX support - #2087

Merged
rafal-hawrylak merged 1 commit into
dataform-co:mainfrom
ikholopov-omni:jit-compile-sqlx
Nov 3, 2026
Merged

rafal-hawrylak merged 1 commit into
dataform-co:mainfrom
ikholopov-omni:jit-compile-sqlx

Conversation

@ikholopov-omni

@ikholopov-omni ikholopov-omni commented Feb 10, 2026 •

Copy link
Copy Markdown
Collaborator

Adds support for compilation_mode: "jit" in SQLX files for table, view, incremental, operations, and assertion actions.

Notes on JiT SQLX vs AoT SQLX:

  • ref() and resolve() are evaluated at JiT execution time against declared dependencies; dependencies must be listed in config { dependencies: [...] }.
  • includes/ globals are only in scope during config evaluation at compile time; values needed inside JiT js {} or SQL blocks should be passed via dataform.jitContextData (exposed as data in JiT context).

@ikholopov-omni
ikholopov-omni force-pushed the jit-compile-sqlx branch 2 times, most recently from 94c2995 to 311db90 Compare February 11, 2026 13:08
@ikholopov-omni
ikholopov-omni marked this pull request as ready for review February 11, 2026 13:19
@ikholopov-omni
ikholopov-omni requested a review from a team as a code owner February 11, 2026 13:19
@ikholopov-omni
ikholopov-omni requested review from udim and removed request for a team February 11, 2026 13:19
@rafal-hawrylak
rafal-hawrylak requested review from Ford544, apilaskowski and mbiernacik and removed request for udim October 22, 2026 20:27

@mbiernacik mbiernacik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main concern: in JiT mode the SQLX code stays a string until run, so problems that AoT reports during compile now only appear at run time:

  1. JiT detection evaluates config early. Configs that reference includes or dataform.* fall back to AoT and fail with a confusing Unexpected property "compilation_mode".
  2. The generated jitCode is never parsed at compile time, so syntax errors (including clashes with the newly injected adapter/data/executionData) only show up at run time.
  3. JiT SQLX behaves differently from AoT SQLX: ref() doesn't register dependencies, and includes don't seem to be available at JiT time.

Could the PR description also mention these differences and assertion support, and link a docs/CHANGELOG update? Details and suggestions inline.

Comment thread core/compilers.ts Resolved
Comment thread core/compilers.ts Resolved
Comment thread core/compilers.ts Resolved
Comment thread core/compilers.ts Resolved
Comment thread core/session.ts Resolved
Comment thread core/compilers.ts Resolved
Comment thread core/compilers.ts Resolved
Comment thread core/compilers.ts Resolved
@rafal-hawrylak

Copy link
Copy Markdown
Collaborator

Addressed inline comments and updated PR description.

@rafal-hawrylak
rafal-hawrylak merged commit 5ffcfa4 into dataform-co:main Nov 3, 2026
12 checks passed
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.

5 participants

⌂ 换网址