Recreate view and triggers
Views and triggers allow your applications to interact with the encrypted data seamlessly. When you create a view on a table, the base table is renamed and a view is created with the original name of the table. Additionally, unique triggers are created for inserts and updates.
Views and triggers are created as part of the data migration. You will need to perform this operation only if you have previously deleted the views and triggers.
Prerequisite
The pdbctl utility must be installed.
Steps
To recreate views and triggers for a table, run the following command:
./pdbctl createview -a <database_alias> -t <table_name>
Flags description
The following table describes the flags and parameters associated with this command:
Flag | Data Type | Description |
---|---|---|
-a | string | Database alias associated with the database user. |
-h | Flag to view help for createview command. | |
-i | string | Insert trigger name. This is an optional parameter. |
-n | string | New table name. This is an optional parameter. |
-t | string | Table name on which views and triggers will be created. |
-u | string | Updated trigger name. This is an optional parameter. |
-- verbose | Print verbose logs. | |
-v | string | View name. This is an optional parameter. |
Example
The following sample command creates the views and triggers for the table CUSTOMERS:
./pdbctl createview -a demo -t CUSTOMERS