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

Configurable context injection mechanisms #96

Open
wesleykendall opened this issue Jun 8, 2023 · 0 comments
Open

Configurable context injection mechanisms #96

wesleykendall opened this issue Jun 8, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@wesleykendall
Copy link
Collaborator

When using pghistory.context, variables are inject into the SQL, meaning an additional SQL statement to set variables is prepending before every SQL statement.

The rationale of this original approach was to avoid any extra surprise queries at all costs, especially for users with poor DB latencies. On the other hand, SQL is now prepended with a statement to set a variable, which fills the SQL log and also does add an overhead to every statement (albeit largely negligible)

I'm planning to spin out the SQL injection and variable setting logic into its own library since this approach is used by other libraries. I will make the variable injection configurable in this library, meaning users of pghistory will be able to configure how context (and other variables) are set

@wesleykendall wesleykendall added the enhancement New feature or request label Jun 8, 2023
This was referenced Jun 8, 2023
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

1 participant