Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G-7730: Clarify scope #114

Closed
PhilippSalvisberg opened this issue Sep 6, 2021 · 1 comment
Closed

G-7730: Clarify scope #114

PhilippSalvisberg opened this issue Sep 6, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@PhilippSalvisberg
Copy link
Collaborator

PhilippSalvisberg commented Sep 6, 2021

Based on Connor McDonald's post More triggers are better I've checked the scope of the guideline. Here the results:

✅ ⠀Simple DML trigger (as in Connor's example)
✅ ⠀Compound DML trigger (same code as above in the before each row section)
⛔️ ⠀Instead of Trigger on views (not possible to assign :new values, no locks on the child table)

Maybe it's worth to mention that in the description of the rule.

BTW. Regarding the implementation of this validator check: The check is implemented only partially. I cannot find what's the primary key based on the trigger code (static code analysis without access to Oracle's data dictionary). Therefore I just assume that the primary key is assigned in the trigger. This might lead to false positives when the primary key is not assigned in the trigger code.

@PhilippSalvisberg PhilippSalvisberg added the enhancement New feature or request label Sep 6, 2021
@kibeha
Copy link
Collaborator

kibeha commented Jul 14, 2022

In the fix for #91 I split the old G-7730 - G-7730 is now general rule of trying to avoid multiple DML events in one trigger, while new G-7740 is specific case concerning this child lock behaviour in case of PK assignment (G-7740 being marked as not possible to validate with PL/SQL Cop).
I'll add this scope explanation to G-7740.

@kibeha kibeha closed this as completed in 8ce6e6e Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants