Ferreteria/v0.6/clade/Sys/Data/Engine/Oper/MyMar/@fx/DoExport
Jump to navigation
Jump to search
About
- General: DoExport
Code
#
// TODO: MySQL/Maria -specific versions of this
// NOTE: This and Engine\Schema\MyMar::DoExport() are both used..
public function DoExport(string $sSchema, RecvBuffClass $oInBuff) : CommOpIface {
$oConnDB = $this->OConn(); // DB connection
$oSockDB = $oConnDB->OSock();
#echo $oSockDB->ReflectThis()->Report();
$oConnSh = $oSockDB->OPlug();
#$oSockSh = $oConnSh->OSock();
#$oConn3 = $oSockSh->OPlug();
#echo 'oConn3 is: '.get_class($oConn3).CRLF; die();
$sCred = $oConnDB->CredsForCmd(); // DB connection string from DB-local shell
$sCmd = "mysqldump $sCred --quick $sSchema"; // "--quick" does line-at-a-time rather than buffering entire table
// should we also try "--single-transaction"? "To dump large tables, you should combine the --single-transaction option with --quick."
// Send dump command directly to shell, not to DB engine:
#echo $$oConnSh->ReflectThis()->Report(); die();
$oAct = $oConnSh->DoCommand($sCmd,$oInBuff,new CommOpClass);
return $oAct;
}