You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add support for view reloptions (security_invoker, security_barrier) (#343) (#347)
* feat: add support for view reloptions (security_invoker, security_barrier) (#343)
Track pg_class.reloptions for views and include WITH clause in generated DDL.
This preserves security_invoker=true and other view options during plan/apply.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: sort view reloptions for deterministic comparison and output
Address review feedback:
- Sort reloptions at ingestion (inspector) so comparison and DDL rendering
are order-insensitive and deterministic
- Deduplicate: viewsEqual now delegates to viewOptionsEqual
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: copy reloptions slice before sorting to avoid mutating shared state
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: testdata/diff/create_view/add_view/plan.json
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,12 @@
26
26
"operation": "create",
27
27
"path": "public.nullif_functions_view"
28
28
},
29
+
{
30
+
"sql": "CREATE OR REPLACE VIEW secure_employee_view WITH (security_invoker=true) AS\n SELECT id,\n name,\n email,\n status\n FROM employees\n WHERE status::text = 'active'::text;",
31
+
"type": "view",
32
+
"operation": "create",
33
+
"path": "public.secure_employee_view"
34
+
},
29
35
{
30
36
"sql": "CREATE OR REPLACE VIEW text_search_view AS\n SELECT id,\n COALESCE((first_name::text || ' '::text) || last_name::text, 'Anonymous'::text) AS display_name,\n COALESCE(email, ''::character varying) AS email,\n COALESCE(bio, 'No description available'::text) AS description,\n to_tsvector('english'::regconfig, (((COALESCE(first_name, ''::character varying)::text || ' '::text) || COALESCE(last_name, ''::character varying)::text) || ' '::text) || COALESCE(bio, ''::text)) AS search_vector\n FROM employees\n WHERE status::text = 'active'::text;",
0 commit comments