Initial commit

Porting all the code from Qiita and extending the tests.
The try except is setup to catch an exception raised from `fetchall`, but can that actually happen? If so, can we please have granularity?