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

Provide plugin example that modifies incoming SQL #883

Open
matchaxnb opened this issue Dec 6, 2024 · 0 comments
Open

Provide plugin example that modifies incoming SQL #883

matchaxnb opened this issue Dec 6, 2024 · 0 comments

Comments

@matchaxnb
Copy link

Is your feature request related to a problem? Please describe.

I want to use a postgresql proxy / bouncer to verify conformity with established rules, log non-conform queries and possibly inject automatic edits. My use case is that I want to enforce the use of a hint /* PROJS(projection_name) */ for some relations. pgcat looks like the best option to fiddle around with performance-wise and architecture-wise.

Describe the solution you'd like
I'd like an example plugin that lets me:

  • iterate over the relations in a query
  • verify if next to them a hint-comment is present that matches the format i expect (in the form of a regex)
  • inserts such a hint with a default value if it's not present already
  • fetches the pairs relation => default hint value in config

Describe alternatives you've considered

  • writing the plugin on my own without an example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant