hfaran/LivesPool — pull request #19 by hfaran (2014-02-11 05:32:10+00:00)
Title: New database module, `db2`

* Wrote an ORM'ish new database module, `db2` which allows access to resources while they are still abstracted behind `dataset` itself. This means I can actually start moving the frankly ridiculous amount of logic implemented in the `db` module, away from the `db` module into the actual RequestHandlers themselves. (Especially the `api_assert`s, oh man those are bad).
* `DBObjectMapping`, while a decent layer of abstraction, IMO, is still a bit of an iffy implementation because it's so expensive (`__getitem__` gets the whole row required from the database and then constructs a new dictionary from that based on required transforms). However, it does provide an actually usable interface, so I guess it makes up enough for that.
* Currently just rewrote the `LeaveGame` handler to use `db2`; will move over other RequestHandlers in future Pull Requests and delete code from the old `db` module along the way until everything is ported and it is no more.