Repository navigation
refactor(eql): write the SQL source with schema and version placeholders #1147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,6 +117,33 @@ fn main() -> ExitCode { | |
| } | ||
| } | ||
|
|
||
| // `render <3|4> <out-dir> <file>...`: write each placeholder source file | ||
| // (relative to the working directory) as that EQL version, to the same | ||
| // relative path under <out-dir>. Consumed by tasks/build.sh, which renders | ||
| // the ordered surface and assembles the installer from the result. | ||
| if args.len() >= 4 && args[1] == "render" { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Generated by Claude Code |
||
| let version = match args[2].parse::<eql_codegen::render::EqlVersion>() { | ||
| Ok(v) => v, | ||
| Err(e) => { | ||
| eprintln!("error: {e}"); | ||
| return ExitCode::from(2); | ||
| } | ||
| }; | ||
| let files: Vec<PathBuf> = args[4..].iter().map(PathBuf::from).collect(); | ||
| return match eql_codegen::render::render_files( | ||
| std::path::Path::new("."), | ||
| &files, | ||
| std::path::Path::new(&args[3]), | ||
| version, | ||
| ) { | ||
| Ok(()) => ExitCode::SUCCESS, | ||
| Err(e) => { | ||
| eprintln!("error: {e}"); | ||
| ExitCode::FAILURE | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| // `clean`: remove the generated SQL surface (marker-aware) under every | ||
| // src/v3/scalars/* type dir. Replaces build.sh's filename-pattern sweep; | ||
| // hand-written files (no AUTO-GENERATED marker) are preserved. | ||
|
|
@@ -152,6 +179,7 @@ fn main() -> ExitCode { | |
| eprintln!("Usage: eql-codegen (generate all types)"); | ||
| eprintln!(" eql-codegen order (print the src/v3 install order, one path per line)"); | ||
| eprintln!(" eql-codegen clean (remove the generated SQL surface)"); | ||
| eprintln!(" eql-codegen render <3|4> <out-dir> <file>... (render placeholder SQL as one EQL version)"); | ||
| eprintln!(" eql-codegen list-types (print catalog tokens)"); | ||
| eprintln!(" eql-codegen list-schemas (print owned schemas, public first)"); | ||
| eprintln!(" eql-codegen dump-catalog (print catalog surface as JSON)"); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking.
args.len() >= 4admitsrender 3 outwith no files: exits 0 and writes nothing. If the$(cat deps-ordered-v3.txt)expansion inbuild.shis ever empty, the render step passes silently. Use>= 5.Source: automated code review (medium) + cross-check (confirmed by reading).
Generated by Claude Code