Documentation: error in SQL Expression Language tutorial(?)
Issue #3648
closed
Hi, I followed the SQLAlchemy SQL Expression Language tutorial from the beginning. I added the code as I went along, including the code for creating the two tables in the section "Define and Create Tables" (section 3.1.3 in the PDF version; the PDF is for Release 1.1.0b1 and dated 13-FEB-2016). When I execute the code an exception is thrown:
"UnboundExecutionError: MetaData object is not bound to an Engine or Connection. Execution can not proceed without a database to execute against."
The code listed in the tutorial includes this line:
metadata = MetaData()
If I change that line to:
metadata = MetaData(bind=engine)
then the code works fine.
Comments (2)
-
reporter -
repo owner - changed status to closed
yeah sorry, I like to encourage not using "bound" metadata :)
- Log in to comment
Crap, I missed the argument to the create_all() function. I had
instead of
Apologies.