web: render table projections in the schema browser (#114)#130
Merged
Conversation
buildHTMLView rendered columns, indexes, constraints, engine and settings for a table but nothing for TableSpec.Projections (added in #113), so a projected table browsed with its projections invisible. Add a Projections section to the table page: each projection's name and canonical query rendered as a query block, like a materialized view's query. New projectionView type + projectionViews builder, wired into buildHTMLView and the object template; unit test for projectionViews and body assertions on the table page. Closes #114.
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.
Closes #114.
Problem
buildHTMLViewrenders sections for columns, indexes, constraints, engine, and settings — but nothing forTableSpec.Projections(added in #113). A projected table browsed with its projections invisible.Fix
Add a Projections section to the table page: each projection's name and canonical query rendered as a query block, like a materialized view's query (SQL doesn't fit a table cell).
projectionView{Name, Query}+projectionViews([]ProjectionSpec)builder (nil when none, so the template omits the section).buildHTMLView(KindTable) andobjectData.web/object.html: aProjectionsheading with an<h3>name +<pre class="code">query per projection.Tests
TestWebSections_ProjectionViews— builder maps the fixture projection; nil for none.TestWebSections_TablePage— asserts the rendered page containsProjections,proj_by_ts, and its query (the fixture already carried a projection, as the issue noted).Full suite green;
go vet+gofmtclean.