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

Invalid table name on Postgresql #196

Open
dschoschu opened this issue Mar 10, 2024 · 0 comments
Open

Invalid table name on Postgresql #196

dschoschu opened this issue Mar 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dschoschu
Copy link

dschoschu commented Mar 10, 2024

Q A
auditor version dev-master 8edca5b
PHP version 8.2.15
Database PostgreSQL

Summary

We use a table called "user" which is a reserved keyword in PostgreSQL. So we have to quote it. For Doctrine the table name is "user". When using Auditor to audit the user table, it builds a table name for the audit table, but does not remove the quotes. So the table name is invalid.

image

I am not sure how SQLite and MySQL handle this, so it could be an edge case.

Current behavior

No insert happens on audited and audit table. No error is reported.

How to reproduce

Audit a table called "user" in PostgreSQL.
Possibly any reserved word of the database vendor. Haven't tried that.

Expected behavior

Auditor builds a valid table name for reserved keywords or at least an error is reported.

Alternative solution

If the change to generate a "valid" audit table name is too complex, a possible solution could be to provide a configuration option to manually specify an audit table name.

@dschoschu dschoschu added the bug Something isn't working label Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant