Moved code for it to one place Updated to chi v5
for Mysql and Postgres in addition to existing Sqlite