docs(data-modeling): correct view data to ID-based body + document ownership/AST validation#195
Merged
Merged
Conversation
…ership + AST validation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Two things:
1. Corrected view docs (the original point of this PR). The view docs added in #187 showed the
databody keyed by name strings (data: { source_schema: 'app_public', source_table: 'owners' }). That is wrong and security-misleading:view_parser.parserequires ID-based input and would reject the name form (BAD_VIEW_EXPRESSION source_table_id).New
references/views.md→ "Referential integrity & ownership" documents why it's ID-based:source_table_id/primary_table_id/ per-jointable_id) goes throughmetaschema_private.assert_same_database(...)→CROSS_DATABASE_REFif it's not in the view'sdatabaseId;field_idsscoped bydatabase_id.source_schema/source_tablein the generatedCREATE VIEWare resolved from the id viametaschema.schema_and_table(id).actions_public.create_view/alter_viewrun the compiled query throughactions_public.validate_ast_for_database(database_id, query, 'query', ...)(same path as check constraints/indexes/functions), restricting referenced schemas to the database's own + framework schemas. Covers theViewCompositeraw-query_astescape hatch.2. Removed all committed
.zipskill packages. They were the source of the repeated, unmergeable binary conflicts on this repo. Deleted all 23 tracked*.ziparchives, added a*.ziprule to.gitignore, and updatedAGENTS.md/CLAUDE.mdto stop instructing agents to commit them.Docs/chore only. No SQL authored (generated-SQL behavior described in prose per the repo rule).
Ref: constructive-db #2416, epic constructive-planning#1236.
Link to Devin session: https://app.devin.ai/sessions/ab8859d00d244aa89bfd11d88f287536
Requested by: @pyramation