-
Notifications
You must be signed in to change notification settings - Fork 73
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
Error in add_new_order_for_customer() #1
Comments
Hello, thanks for raising this and creating an issue! Let me start by saying that you're doing nothing wrong. It seems like you've followed the tutorial correctly. The issue lies in SQLite configuration. sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "RETURNING": syntax error The above error you're getting is not because of SQLAlchemy or the code itself, but due to Python picking up the older SQLite version, where When we built this tutorial with Python 3.12 (3.12.x) few months ago, it picked up SQLite version > 3.35.0 and the code worked (we had tested this multiple times end-to-end and delivered the tutorial to a few conferences). >>> import sqlite3
>>> sqlite3.version
>>> '2.6.0'
>>> sqlite3.sqlite_version
>>> '3.31.1' Since SQLite 3.31.1 doesn't have the support for Now you could try installing the newer version of SQLite (within the same Python), but it's going to be hard since You could either install a different version of Python with From the VSCode command palette, click on "Codespaces: Add Dev Container Configuration Files", then "Add New Configuration", and "Show All Definitions". Choose Now you should have Python 3.12.7, and once you check the sqlite version, you should have one > 3.35.0, that supports >>> sqlite3.sqlite_version
>>> '3.40.1' Now, you can finally create a virtual environment, install dependencies and run the server. While running
I hope this helps, hoping you learn something new from the tutorial! I think I might add an info/warning in our tutorial docs about this as well. |
Hello. I've been working my way through this very thorough and professionally presented tutorial, and have into a problem.
When attempting to call
./run.sh neworder
, I get a Bad Request error. Here is the log output:At first, I suspected the edits I was making to the code while following the tutorial were the problem, but I don't think so, since when I do a fresh checkout of the step-2-sqlalchemy branch, the same error occurs.
Python is 3.12.1, as in the tutorial. Not sure whether it's a dependency issue. Here is the output of
pip list
:I would be most grateful if you could point what I'm doing wrong, so I can continue with the tutorial.
Cheers.
The text was updated successfully, but these errors were encountered: