@@ -31,9 +31,9 @@ public function getImportCommand(string $dumpFile, string $connection): string
3131 ];
3232
3333 if (str ($ dumpFile )->endsWith ('sql ' )) {
34- $ command = $ this ->getMySqlImportCommandForUncompressedDump ($ importToDatabase , $ dumpFile , $ credentialsArray );
34+ $ command = $ this ->getMySqlImportCommandForUncompressedDump ($ importToDatabase , $ dumpFile , $ credentialsArray, $ connection );
3535 } else {
36- $ command = $ this ->getMySqlImportCommandForCompressedDump ($ dumpFile , $ importToDatabase , $ credentialsArray );
36+ $ command = $ this ->getMySqlImportCommandForCompressedDump ($ dumpFile , $ importToDatabase , $ credentialsArray, $ connection );
3737 }
3838
3939 return $ command ;
@@ -47,7 +47,7 @@ public function getCliName(): string
4747 /**
4848 * @throws ImportFailed
4949 */
50- private function getMySqlImportCommandForCompressedDump (string $ storagePathToDatabaseFile , string $ importToDatabase , array $ credentials ): string
50+ private function getMySqlImportCommandForCompressedDump (string $ storagePathToDatabaseFile , string $ importToDatabase , array $ credentials, string $ connection ): string
5151 {
5252 $ quote = $ this ->determineQuote ();
5353 $ password = $ credentials ['password ' ];
@@ -67,10 +67,11 @@ private function getMySqlImportCommandForCompressedDump(string $storagePathToDat
6767 '-P ' , $ credentials ['port ' ],
6868 isset ($ credentials ['host ' ]) ? '-h ' .$ credentials ['host ' ] : '' ,
6969 $ importToDatabase ,
70+ $ this ->getOptions ($ connection ),
7071 ])->filter ()->implode (' ' );
7172 }
7273
73- private function getMySqlImportCommandForUncompressedDump (string $ importToDatabase , string $ storagePathToDatabaseFile , array $ credentials ): string
74+ private function getMySqlImportCommandForUncompressedDump (string $ importToDatabase , string $ storagePathToDatabaseFile , array $ credentials, string $ connection ): string
7475 {
7576 $ quote = $ this ->determineQuote ();
7677 $ password = $ credentials ['password ' ];
@@ -82,8 +83,14 @@ private function getMySqlImportCommandForUncompressedDump(string $importToDataba
8283 '-P ' , $ credentials ['port ' ],
8384 isset ($ credentials ['host ' ]) ? '-h ' .$ credentials ['host ' ] : '' ,
8485 $ importToDatabase ,
86+ $ this ->getOptions ($ connection ),
8587 '< ' ,
8688 $ storagePathToDatabaseFile ,
8789 ])->filter ()->implode (' ' );
8890 }
91+
92+ private function getOptions (string $ connection ): string
93+ {
94+ return config ("database.connections. {$ connection }.dump.options " , '' );
95+ }
8996}
0 commit comments