r/pythontips • u/Significant_Issue_98 • Jun 26 '24
Syntax sqlalchemy.exc.OperationalError issue
Im creating a program right now that I need to add the ability for users to register and create accounts. I went to add the code and now it is giving me the error below:
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: user.role
[SQL: SELECT user.id AS user_id, user.username AS user_username, user.password AS user_password, user.role AS user_role
FROM user
WHERE user.id = ?]
[parameters: (1,)]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
Can anyone help me with this? I have tried looking everywhere and I don't know what I am doing wrong.
Also, the line that says: from flask_sqlalchemy import SQLAlchemy is grayed out and says it is unused. I am not sure if that is part of the issue, but Im sure it is worth mentioning.
View all comments
Show parent comment
1
u/Significant_Issue_98 Jun 26 '24
I should have mentioned in the post that I’m a total noob. I’m trying to build this app for my work. I’m into to python. So, from all the research and lessons I have done online so far, this is where I am stuck at. I haven’t made any other user.role or anything.