NAME

DBIO::PostgreSQL::Diff::Policy - Diff operations for PostgreSQL Row Level Security policies

VERSION

version 0.900000

DESCRIPTION

Represents a Row Level Security diff operation: CREATE POLICY, DROP POLICY, ENABLE ROW LEVEL SECURITY, or DISABLE ROW LEVEL SECURITY. RLS enable/disable changes on tables are detected by comparing the rls_enabled flag from table introspection.

ATTRIBUTES

table_key

The schema.table key identifying the table.

policy_name

The policy name (not set for enable_rls / disable_rls operations).

policy_info

Policy metadata hashref (command, permissive, using_expr, check_expr, roles).

METHODS

diff

my @ops = DBIO::PostgreSQL::Diff::Policy->diff(
    $source_pol, $target_pol, $source_tables, $target_tables,
);

Compares RLS state and policy sets. Detects RLS enable/disable changes on existing tables, new policies, and dropped policies.

as_sql

Returns the SQL for this operation: ALTER TABLE ... ENABLE/DISABLE ROW LEVEL SECURITY, CREATE POLICY ..., or DROP POLICY ... ON ....

summary

Returns a one-line description such as +policy: users_own_data on auth.users or enable_rls on auth.users.

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.