Add SQLView profile for composable queries - #364
Merged
Conversation
Initialise OpenSpec with the jg-spec-driven schema and add the add-sqlview-profile change: proposal, specs, design, and tasks. The change captures the resolution for inter-query dependencies - a new SQLView Library profile (sql-view type, no parameters) and widening the SQLQuery relatedArtifact rule to reference ViewDefinitions or SQLViews.
Update the add-sqlview-profile change to constrain relatedArtifact.resource with only Canonical(ViewDefinition or SQLView) on both profiles, rather than leaving the canonical unconstrained and documented in prose. This makes the allowed dependency targets machine-readable and validated whenever the canonical resolves, with the ^short retained as a fallback for unresolvable references. Notes the logical-model nature of ViewDefinition as a build verification point. Also soften the composition requirement so acyclicity is advised (SHOULD) rather than mandated, with cycle handling left to implementations, matching the issue #329 resolution.
Introduce an SQLView Library profile representing a reusable, named query that other queries reference as a virtual table source, resolving issue #329. SQLView fixes its type to LibraryTypesCodes#sql-view, prohibits parameters, and carries SQL using the same attachment rules as SQLQuery. Constrain relatedArtifact.resource on both SQLView and SQLQuery to Canonical(ViewDefinition or SQLView) so the allowed dependency targets are machine-readable and validated whenever the canonical resolves. Add the sql-view code to LibraryTypesCodes, an SQLView example composed by an SQLQuery, documentation describing query composition, and a SQL View menu entry.
Move the completed add-sqlview-profile change to the archive and create the sql-view capability spec in the main specs from the change's delta.
niquola
approved these changes
Jun 7, 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.
This branch adds a SQLView profile so that views can be composed from other queries, alongside related refinements to the SQLQuery artifacts.
The main changes are:
Closes #329.