Skip to content

Commit b253c6f

Browse files
committed
Update supported platforms
1 parent 0229cd2 commit b253c6f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/LaravelMaskedDump.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
use BeyondCode\LaravelMaskedDumper\TableDefinitions\TableDefinition;
88
use Doctrine\DBAL\Platforms\MariaDBPlatform;
99
use Doctrine\DBAL\Platforms\MySQLPlatform;
10-
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
1110
use Doctrine\DBAL\Platforms\SqlitePlatform;
12-
use Doctrine\DBAL\Platforms\SQLServerPlatform;
1311
use Illuminate\Database\Connection as DatabaseConnection;
1412
use Doctrine\DBAL\Platforms\AbstractPlatform;
1513

@@ -89,12 +87,11 @@ protected function getPlatform(DatabaseConnection $connection)
8987
return new MySQLPlatform;
9088
case 'mariadb':
9189
return new MariaDBPlatform;
92-
case 'pgsql':
93-
return new PostgreSQLPlatform;
94-
case 'sqlite':
95-
return new SqlitePlatform;
9690
default:
97-
throw new \RuntimeException("Unsupported platform: {$connection->getDriverName()}");
91+
if ($connection->getDriverName() === 'sqlite' && $this->isTesting()) {
92+
return new SqlitePlatform;
93+
}
94+
throw new \RuntimeException("Unsupported platform: {$connection->getDriverName()}. Please check the documentation for more information.");
9895
}
9996
}
10097

@@ -141,4 +138,8 @@ protected function dumpTableData(TableDefinition $table)
141138

142139
return $query;
143140
}
141+
142+
protected function isTesting(): bool {
143+
return config('app.env') === 'workbench' || config('app.env') === 'ci';
144+
}
144145
}

0 commit comments

Comments
 (0)