Skip to content

docs(data-modeling): document view security_barrier + WITH CHECK OPTION (ORM SDK)#187

Merged
pyramation merged 6 commits into
mainfrom
feat/view-check-option-security-barrier-docs
Jul 22, 2026
Merged

docs(data-modeling): document view security_barrier + WITH CHECK OPTION (ORM SDK)#187
pyramation merged 6 commits into
mainfrom
feat/view-check-option-security-barrier-docs

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Documents the two view options added to the metaschema in constructive-db PR #2416 (PG18 epic constructive-planning#1236) as SDK/ORM API docs in the constructive-data-modeling skill. No raw SQL is authored — examples use db.view.create / db.view.update, per the repo's "document the SDK/ORM surface only" rule (generated-SQL behavior is shown as // → comments, which the rule permits).

Previously the skill had no view documentation at all; this adds a Views section plus a focused reference.

New view options (alongside the existing securityInvoker):

Option Type Default Generates
securityBarrier Boolean false WITH (security_barrier = true)
checkOption String null WITH [LOCAL|CASCADED] CHECK OPTION (null | 'local' | 'cascaded')
await db.view.create({
  data: {
    databaseId, schemaId, name: 'owners_view',
    viewType: 'ViewTableProjection', tableId: ownersTableId,
    data: { source_schema: 'app_public', source_table: 'owners' },
    securityBarrier: true, checkOption: 'cascaded', isReadOnly: false,
  },
  select: { id: true },
}).execute();
// → CREATE VIEW app_public.owners_view
//     WITH (security_invoker = true, security_barrier = true) AS
//     SELECT ... WITH CASCADED CHECK OPTION

Changes

  • constructive-data-modeling/SKILL.md: new Views section, When to Apply bullet, References-table entry, and frontmatter trigger phrases (create a view, security_barrier, WITH CHECK OPTION, check_option).
  • constructive-data-modeling/references/views.md (new): view creation via db.view.create, the three view options, valid checkOption values, update semantics, and generated pg_class.reloptions behavior.
  • constructive-data-modeling.zip: repackaged to match (per AGENTS.md).

Link to Devin session: https://app.devin.ai/sessions/ab8859d00d244aa89bfd11d88f287536
Requested by: @pyramation

@pyramation pyramation self-assigned this Jul 22, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pyramation
pyramation merged commit a509ff2 into main Jul 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant