Function that prepares the database connection.
If not overridden, the default prepare function
enables the foreign_key pragma on the DB connection.
@param connection The database connection.
@returns A promise that resolves when the database connection is prepared.