diff --git a/docs/pages/getting_started.md b/docs/pages/getting_started.md index eaab99c9..cdd0991e 100644 --- a/docs/pages/getting_started.md +++ b/docs/pages/getting_started.md @@ -317,7 +317,7 @@ bin/console event-sourcing:subscription:setup You can find out more about the cli in the [library](https://event-sourcing.patchlevel.io/latest/cli/). -### Usage +## Usage We are now ready to use the Event Sourcing System. We can load, change and save aggregates. diff --git a/src/Doctrine/DbalConnectionFactory.php b/src/Doctrine/DbalConnectionFactory.php index e8e94b3f..babf31bb 100644 --- a/src/Doctrine/DbalConnectionFactory.php +++ b/src/Doctrine/DbalConnectionFactory.php @@ -10,10 +10,27 @@ final class DbalConnectionFactory { + /** + * Mapping was taken from Doctrine Bundle. + * + * @see https://github.com/doctrine/DoctrineBundle/blob/7564fa72ab4a87316660347ccd226cefc8fb0ea9/src/ConnectionFactory.php#L35 + */ + private const DEFAULT_SCHEME_MAP = [ + 'db2' => 'ibm_db2', + 'mssql' => 'pdo_sqlsrv', + 'mysql' => 'pdo_mysql', + 'mysql2' => 'pdo_mysql', // Amazon RDS, for some weird reason + 'postgres' => 'pdo_pgsql', + 'postgresql' => 'pdo_pgsql', + 'pgsql' => 'pdo_pgsql', + 'sqlite' => 'pdo_sqlite', + 'sqlite3' => 'pdo_sqlite', + ]; + public static function createConnection(string $url): Connection { return DriverManager::getConnection( - (new DsnParser())->parse($url), + (new DsnParser(self::DEFAULT_SCHEME_MAP))->parse($url), ); } }