-
Notifications
You must be signed in to change notification settings - Fork 195
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
Editing a model fails with an incorrect id value in the query #413
Comments
Hey, |
Yes they are bigints. I can try to sanitize my models |
Thankfully I was able to remove all the relationships and it still fails! |
Yeah it's a weird case happening with asyncpg only. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checklist
master
.Describe the bug
Tried editing a model and it crashed. I had to wrap the "rows = await self._run_query(stmt)" line in the get_model_objects function in the models.py file to get an exception (no exceptions get pushed to output or logged!)
Exception:
ProgrammingError("(sqlalchemy.dialects.postgresql.asyncpg.ProgrammingError) <class 'asyncpg.exceptions.UndefinedFunctionError'>: operator does not exist: bigint = character varying HINT: No operator matches the given name and argument types. You might need to add explicit type casts.")
The query generated had this for the where clause:
WHERE company.id = :id_8
Obviously the company.id is a bigint, and it shows the correct id of '1' in the admin list view...
Steps to reproduce the bug
No response
Expected behavior
No response
Actual behavior
No response
Debugging material
No response
Environment
WSL 2
Python 3.11.1
Latest SQLAdmin
Additional context
No response
The text was updated successfully, but these errors were encountered: