Mysql/Sqlite implementation