Fix promise waiting for sqlite with `key` option
Fix promise waiting for sqlite with `key` option

If a `key` option is passed to the Sqlite driver, the connection promise does not wait on it and resolves on the first pragma. This PR makes sure that the Promise returned will wait for the key PRAGMA to be run.

Also took some time to simplify the reading of the createDatabaseConnection() function.

gintsgints/typeorm,typeorm/typeorm,gintsgints/typeorm,typeorm/typeorm,typeorm/typeorm