Forums

SQLite connection fails in-app via SQLAlchemy.create_engine, but works otherwise?

[edit: =====SOLVED===== ~ tldr: silly mistakes unrelated to SQL]

I'm attempting to connect to an sqlite database via an absolute path connection string. It works fine both via sqlite3.connect and via SQLAlchemy.create_engine if I use a python instance in bash console (in both cases I'm able to select against the db).

However, within the app itself, I can access it (and select) just fine via sqlite3.connect(), but the SQLAlchemy.create_engine(...).connect().execute('SELECT * FROM my_table') style fails.

I'm continuing to narrow it down (it is very likely a stupid mistake on my part) and will post again as I get more details (or solve it), but if anyone has solutions/suggestions off the top of their head, I would appreciate it!

[edit] Amazing how, flailing for a few hours, I can then find/solve the mistakes immediately after posting for help! I rewrote my test from scratch and the select started working. The table auto-load was still broken, but then I realized I typoed and put auto_load=True, not autoload=True... assuming that both select and autoload were failing for the same reason made debugging take longer than it should of... clearly I need more coffee. Sorry for crying wolf!

Glad you got it sorted :-)