Sql support, fixes #9