Final Elixir/SQLAlchemy frustration post

I’m going to stop complaining about Elixir and SQLAlchemy now. Not because I suddenly realized how great it is, but because I gave up.
For anyone not familiar with these things, SQLAlchemy is “the Python SQL toolkit and Object Relational Mapper” and Elixir is “a declarative layer on top of the SQLAlchemy library, a fairly thin wrapper, which provides the ability to create simple Python classes that map directly to relational database tables”. Sound nice enough.
But the last days I’ve been tearing my hair out trying to get the sessions and rollbacks to work and today I finally gave up. No sessions for this system! Now it’s all auto-commits and manual rollbacks and things are working! This (not so pretty) solution …

Snowed in

It’s been snowing quite a lot in Stockholm lately, and despite Sweden being a country where this snow thing happens every year, it’s now nearly impossible to get anywhere unless you live in the inner city or are prepared to walk. The subway trains now only function below ground (which means only in the inner city), the buses have problems braking at some stops because of icy roads and many buses are being used to replace the subway traffic. There aren’t nearly enough buses for this though, as one full subway train would need 10 buses as replacement!
Combine this with a temperature lower than city people are used to (-20 C yesterday) and we have chaos. Or at least that’s …

SQLAlchemy? Really?

The last days have been very frustrating, as I’ve been trying to get SQLAlchemy to do as I want.
The problem?
Completely useless error logs, that’s the problem!
Turns out both of the problems that made me want to throw my laptop out of the window was related to different kind of keys and indexes, but this was by no means something the log would give me a clue to. The log typically told me where in the SQLAlchemy python code there was an error, but this information had no connection what so ever to my code or the actual error. Combine this with SQLAlchemys very unpredictable behaviour when adding data to tables where the primary keys of the baseclass and subclass didn’t …

Lonely coding

Coding all alone can be a problem. There are plenty of developer communities online, but sometimes I get stuck and just need a fresh pair of eyes to take a look at my code. I like working alone, but I also believe in code reviews and pair programming and that’s often not an option for me these days.
Yesterday I’d been struggling with a stupid SQLAlchemy error for hours and the error logs basically said “doing a rollback, something went WRONG”. The more the feeling of resignation came crawling, the smaller the chance of effective debugging. Before freelancing, when I always had a bunch of developers around, I would simply have asked one of them.
Luckily I have in-house expertise, living …