feat: Support shared scripts#2161
Merged
Merged
Conversation
63c6a5a to
97352f3
Compare
654544c to
30378a5
Compare
7419e4c to
ee637c7
Compare
671a579 to
28f9f02
Compare
mateczagany
reviewed
Jun 26, 2026
mbroecheler
reviewed
Jun 27, 2026
mateczagany
approved these changes
Jun 30, 2026
# Conflicts: # sqrl-planner/src/main/java/com/datasqrl/planner/SqlScriptPlanner.java
2177f88 to
59c1f33
Compare
ferenc-csaky
added a commit
that referenced
this pull request
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key Changes
buildtoworkspaceinside Docker container-r, --project-rootto explicitly set relative project root to the mount pointa/b/c/d/package.json,a/b/c/package.json,a/b/package.json->a/b)sharedconfig option undermain(see details below)rootprefix for import paths (IMPORT root.my.import.script;), which will always try to resolve the given path against the project root folder, even if the defining script is in a submoduleSqrlPreprocessor, which now deals with the shared scripts, and the Mustache template resolutionShared script concept
We can now setup packages that we plan to share between multiple projects. Most probably these will be data catalogs. It can be arranged as regular SQRL project, with the restriction the it requires a
package.jsonnamed config in its root:That package JSON can be minimal, and may contain an information about the project and define config variables if the defined shared script content has any of them:
{ "version": "1", "information": { "description": "Common table definitions for banking test use cases" }, "script": { "config": { "monitorInterval": "10s" } } }Then, we can add
banking-sharedto our regular SQRL project's package like:The key name under
sharedwill define the name of the shared module, which it can be imported by.A shared script
IMPORTwill look like this:Important
In most cases the
rootprefix is optional, except when the caller script is in a subdirectory, it has to be present to be able to import from the build root.TODO