Module Expr Str Import alias ImportFrom alias Assign NameStore Str Assign NameStore Str Assign NameStore Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Dict Str Dict Str Str Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Assign NameStore Dict Str ListLoad Dict Str Dict Str Str Dict Str Dict Str Str Dict Str Dict Str Str Str Str NameLoad Str Assert CompareEq NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Dict Str Dict Str Str With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Dict Str Dict Str Str With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Dict Str Dict Str Str With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str Dict Str Str Dict Str Dict Str Str Str Str NameLoad Str Dict Str Dict Str ListLoad Str Dict Str Dict Str Str Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Assign NameStore Dict Str ListLoad Dict Str Dict Str Str Dict Str Dict Str Str Dict Str Dict Str Str Str Str NameLoad Str Assert CompareEq NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str Dict Str Dict Str Dict Str Str Dict Str Dict Str Str Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Assign NameStore Dict Str Str ListLoad Dict Str Dict Str Str Dict Str Dict Str Str Dict Str Dict Str Str Str NameLoad Dict Str Dict Str Str Str Str ListLoad Str Str Str Str Str Assign NameStore Dict Str Str Str Str Str Str Str NameLoad Str NameLoad Assert CompareEq SubscriptLoad SubscriptLoad NameLoad Index Str Index Str NameLoad Assert CompareEq SubscriptLoad SubscriptLoad NameLoad Index Str Index Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str Dict Str Dict Str Dict Str Str Dict Str Dict Str Str Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Assign NameStore Dict Str ListLoad Dict Str Dict Str Str Dict Str Dict Str Str Dict Str Dict Str Str Str Str NameLoad Str Assert CompareEq NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Dict Str Dict Str Str Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Assign NameStore Dict Str Str ListLoad Dict Str Dict Str Str Dict Str Dict Str Str Dict Str Dict Str Str Str NameLoad Dict Str Dict Str Str Str NameLoad Dict Str Dict Str Str Str Str ListLoad Str Str Str Str Assert CompareEq NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Assert CompareEq SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str Str Assert CompareEq SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str Assign NameStore Dict Str Dict Str Dict Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Dict Str Str ListLoad Dict Str Dict Str Str Dict Str Dict Str Str Dict Str Dict Str Str Str NameLoad Dict Str Dict Str Str Str NameLoad Dict Str Dict Str Str Str Str ListLoad Str Str Str Str Assert CompareEq NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Assert CompareEq SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str Str Assert CompareEq SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad NameLoad Str Str Assign NameStore Dict Str Dict Str Dict Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore ListLoad Dict Str Dict Str Str Dict Str Dict Str Str Dict Str Dict Str Str Str NameLoad Dict Str Dict Str Str Str NameLoad Assert CompareEq NameLoad SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad NameLoad Str Str Assign NameStore Dict Str Dict Str Dict Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore ListLoad Dict Str Dict Str Str Dict Str Dict Str Str Dict Str Dict Str Str Str NameLoad Dict Str Dict Str Str Str NameLoad Assert CompareEq NameLoad SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore Dict Str Str Dict Str Str Str Str Dict Str Dict Str Str ListLoad Str Str ListLoad Str Dict Str NameLoad Dict Str Dict Str Str Str Str Str Str Str Str NameLoad Str Dict Str Dict Str Str Str Str Str ListLoad Str Str Str Str Str Str Dict Str Dict Str Str Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Assign NameStore Dict Str Str ListLoad Dict Str Dict Str Str Dict Str Dict Str Str Dict Str Dict Str Str Str NameLoad Dict Str Dict Str Str Str NameLoad Dict Str Dict Str Str Str Str ListLoad Str Str Str Str Str Assert CompareEq NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Assert CompareEq SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str Str Assert CompareEq SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore Dict Str Str Dict Str Str Str Dict Str Dict Str Str ListLoad Str Str ListLoad Str Dict Str Dict Str Str Str Str Str Str Str Str NameLoad NameLoad Dict Str Dict Str Str Str Str Str ListLoad Str Str Str Str Str Str Dict Str Dict Str Str Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Assign NameStore Dict Str Str ListLoad Dict Str Dict Str Str Dict Str Dict Str Str Dict Str Dict Str Str Str NameLoad Dict Str Dict Str Str Str NameLoad Dict Str Dict Str Str Str Str ListLoad Str Str Str Str Str Assert CompareEq NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Assert CompareEq SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str Str Assert CompareEq SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str NameLoad decorator_list decorator_list
N/A N/A Test audit columns N/A pytest pyrseas.testutils AugmentToMapTestCase N/A CREATE_STMT CREATE TABLE t1 (c1 integer, c2 text) N/A FUNC_SRC1 
BEGIN
  NEW.modified_by_user = SESSION_USER;
  NEW.modified_timestamp = CURRENT_TIMESTAMP;
  RETURN NEW;
END N/A FUNC_SRC2 
BEGIN
  NEW.updated = CURRENT_TIMESTAMP;
  RETURN NEW;
END AuditColumnsTestCase N/A AugmentToMapTestCase N/A N/A Test mapping of audit column augmentations test_predef_column N/A N/A self N/A N/A N/A Add predefined audit column N/A augmap N/A schema public N/A table t1 N/A audit_columns created_date_only N/A dbmap N/A N/A self to_map N/A CREATE_STMT augmap N/A expmap N/A columns N/A N/A c1 N/A type integer N/A c2 N/A type text N/A created_date N/A type not_null default date True ('now'::text)::date N/A N/A expmap N/A N/A dbmap N/A schema public N/A table t1 N/A test_unknown_table N/A N/A self N/A N/A N/A Error on non-existent table N/A augmap N/A schema public N/A table t2 N/A audit_columns created_date_only N/A N/A N/A pytest raises KeyError N/A N/A N/A N/A self to_map N/A CREATE_STMT augmap N/A test_bad_audit_spec N/A N/A self N/A N/A N/A Error on bad audit column specification N/A augmap N/A schema public N/A table t1 N/A audit_column created_date_only N/A N/A N/A pytest raises KeyError N/A N/A N/A N/A self to_map N/A CREATE_STMT augmap N/A test_unknown_audit_spec N/A N/A self N/A N/A N/A Error on non-existent audit column specification N/A augmap N/A schema public N/A table t1 N/A audit_columns created_date N/A N/A N/A pytest raises KeyError N/A N/A N/A N/A self to_map N/A CREATE_STMT augmap N/A test_new_column N/A N/A self N/A N/A N/A Add new (non-predefined) audit column N/A augmap N/A augmenter schema public N/A columns audit_columns N/A modified_date N/A type not_null default date True ('now'::text)::date N/A modified_date_only N/A columns N/A modified_date N/A table t1 N/A audit_columns modified_date_only N/A dbmap N/A N/A self to_map N/A CREATE_STMT augmap N/A expmap N/A columns N/A N/A c1 N/A type integer N/A c2 N/A type text N/A modified_date N/A type not_null default date True ('now'::text)::date N/A N/A expmap N/A N/A dbmap N/A schema public N/A table t1 N/A test_rename_column N/A N/A self N/A N/A N/A Add predefined audit column but with new name N/A augmap N/A augmenter schema public N/A columns N/A modified_timestamp N/A name updated N/A table t1 N/A audit_columns modified_only N/A dbmap N/A N/A self to_map N/A CREATE_STMT augmap N/A colmap N/A columns triggers N/A N/A c1 N/A type integer N/A c2 N/A type text N/A updated N/A type not_null timestamp with time zone True N/A t1_20_audit_modified_only N/A events level procedure timing N/A insert update row audit_modified() before N/A funcmap N/A language returns security_definer description source plpgsql trigger True Provides modified_timestamp values for audit columns. FUNC_SRC2 N/A N/A N/A N/A dbmap N/A schema public N/A table t1 colmap N/A N/A N/A N/A dbmap N/A schema public N/A function audit_modified() funcmap N/A test_change_column_type N/A N/A self N/A N/A N/A Add predefined audit column but with changed datatype N/A augmap N/A augmenter schema public N/A columns N/A created_date N/A type text N/A table t1 N/A audit_columns created_date_only N/A dbmap N/A N/A self to_map N/A CREATE_STMT augmap N/A expmap N/A columns N/A N/A c1 N/A type integer N/A c2 N/A type text N/A created_date N/A type not_null default text True ('now'::text)::date N/A N/A expmap N/A N/A dbmap N/A schema public N/A table t1 N/A test_columns_with_trigger N/A N/A self N/A N/A N/A Add predefined audit columns with trigger N/A augmap N/A schema public N/A table t1 N/A audit_columns default N/A dbmap N/A N/A self to_map N/A CREATE_STMT augmap N/A expmap N/A columns triggers N/A N/A c1 N/A type integer N/A c2 N/A type text N/A modified_by_user N/A type not_null character varying(63) True N/A modified_timestamp N/A type not_null timestamp with time zone True N/A t1_20_audit_default N/A events level procedure timing N/A update row audit_default() before N/A N/A expmap N/A N/A dbmap N/A schema public N/A table t1 N/A N/A N/A N/A N/A dbmap N/A schema public N/A function audit_default() N/A returns trigger N/A N/A N/A N/A N/A dbmap N/A schema public N/A function audit_default() N/A source FUNC_SRC1 N/A test_nonpublic_schema_with_trigger N/A N/A self N/A N/A N/A Add predefined audit columns with trigger in a non-public schema N/A stmts N/A CREATE SCHEMA s1 CREATE TABLE s1.t1 (c1 integer, c2 text) N/A augmap N/A schema s1 N/A table t1 N/A audit_columns default N/A dbmap N/A N/A self to_map stmts augmap N/A expmap N/A columns triggers N/A N/A c1 N/A type integer N/A c2 N/A type text N/A modified_by_user N/A type not_null character varying(63) True N/A modified_timestamp N/A type not_null timestamp with time zone True N/A t1_20_audit_default N/A events level procedure timing N/A update row s1.audit_default() before N/A N/A expmap N/A N/A dbmap N/A schema s1 N/A table t1 N/A N/A N/A N/A N/A dbmap N/A schema s1 N/A function audit_default() N/A returns trigger N/A N/A N/A N/A N/A dbmap N/A schema s1 N/A function audit_default() N/A source FUNC_SRC1 N/A test_skip_existing_columns N/A N/A self N/A N/A N/A Do not add already existing audit columns N/A stmts N/A CREATE_STMT ALTER TABLE t1 ADD modified_by_user varchar(63) NOT NULL ALTER TABLE t1 ADD modified_timestamp timestamp with time zone NOT NULL N/A augmap N/A schema public N/A table t1 N/A audit_columns default N/A dbmap N/A N/A self to_map stmts augmap N/A expmap N/A N/A c1 N/A type integer N/A c2 N/A type text N/A modified_by_user N/A type not_null character varying(63) True N/A modified_timestamp N/A type not_null timestamp with time zone True N/A N/A expmap N/A N/A N/A dbmap N/A schema public N/A table t1 N/A columns N/A test_change_existing_columns N/A N/A self N/A N/A N/A Change already existing audit columns N/A stmts N/A CREATE_STMT ALTER TABLE t1 ADD modified_by_user text  ALTER TABLE t1 ADD modified_timestamp timestamp with time zone NOT NULL N/A augmap N/A schema public N/A table t1 N/A audit_columns default N/A dbmap N/A N/A self to_map stmts augmap N/A expmap N/A N/A c1 N/A type integer N/A c2 N/A type text N/A modified_by_user N/A type not_null character varying(63) True N/A modified_timestamp N/A type not_null timestamp with time zone True N/A N/A expmap N/A N/A N/A dbmap N/A schema public N/A table t1 N/A columns N/A test_custom_function_template N/A N/A self N/A N/A N/A Add new (non-predefined) audit trigger using a function template N/A template 
        BEGIN
          NEW.{{modified_by_user}} = SESSION_USER;
          NEW.{{modified_timestamp}} = CURRENT_TIMESTAMP::timestamp(0);
          RETURN NEW;
        END N/A source 
        BEGIN
          NEW.modified_by_user = SESSION_USER;
          NEW.modified_timestamp = CURRENT_TIMESTAMP::timestamp(0);
          RETURN NEW;
        END N/A augmap N/A augmenter schema public N/A audit_columns function_templates functions triggers N/A custom N/A columns triggers N/A modified_by_user modified_timestamp N/A custom_audit N/A custom_template template N/A custom_audit() N/A description language returns security_definer source Maintain custom audit columns plpgsql trigger True {{custom_template}} N/A custom_audit N/A events level name procedure timing N/A insert update row {{table_name}}_20_custom_audit custom_audit() before N/A table t1 N/A audit_columns custom N/A dbmap N/A N/A self to_map N/A CREATE_STMT augmap N/A expmap N/A columns triggers N/A N/A c1 N/A type integer N/A c2 N/A type text N/A modified_by_user N/A type not_null character varying(63) True N/A modified_timestamp N/A type not_null timestamp with time zone True N/A t1_20_custom_audit N/A events level procedure timing N/A insert update row custom_audit() before N/A N/A expmap N/A N/A dbmap N/A schema public N/A table t1 N/A N/A N/A N/A N/A dbmap N/A schema public N/A function custom_audit() N/A returns trigger N/A N/A N/A N/A N/A dbmap N/A schema public N/A function custom_audit() N/A source source N/A test_custom_function_inline_with_column_substitution N/A N/A self N/A N/A N/A Add new (non-predefined) audit trigger using an inline definition N/A template 
        BEGIN
          NEW.{{modified_by_user}} = SESSION_USER;
          NEW.{{modified_timestamp}} = CURRENT_TIMESTAMP::timestamp(0);
          RETURN NEW;
        END N/A source 
        BEGIN
          NEW.modified_by_user = SESSION_USER;
          NEW.modified_timestamp = CURRENT_TIMESTAMP::timestamp(0);
          RETURN NEW;
        END N/A augmap N/A augmenter schema public N/A audit_columns functions triggers N/A custom N/A columns triggers N/A modified_by_user modified_timestamp N/A custom_audit N/A custom_audit() N/A description language returns security_definer source Maintain custom audit columns plpgsql trigger True template N/A custom_audit N/A events level name procedure timing N/A insert update row {{table_name}}_20_custom_audit custom_audit() before N/A table t1 N/A audit_columns custom N/A dbmap N/A N/A self to_map N/A CREATE_STMT augmap N/A expmap N/A columns triggers N/A N/A c1 N/A type integer N/A c2 N/A type text N/A modified_by_user N/A type not_null character varying(63) True N/A modified_timestamp N/A type not_null timestamp with time zone True N/A t1_20_custom_audit N/A events level procedure timing N/A insert update row custom_audit() before N/A N/A expmap N/A N/A dbmap N/A schema public N/A table t1 N/A N/A N/A N/A N/A dbmap N/A schema public N/A function custom_audit() N/A returns trigger N/A N/A N/A N/A N/A dbmap N/A schema public N/A function custom_audit() N/A source source N/A N/A