Fork of SQL wrapper by @jmelloy