Moved SQL related code to package database.