Ferreteria/v0.6/clade/Sys/Data/Engine/Oper/MyMar/@fx/DoExport

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Data‎ | Engine‎ | Oper‎ | MyMar
Revision as of 20:06, 2 December 2025 by Woozle (talk | contribs) (Created page with "{{page/fx}} ==About== * '''General''': {{l/ver/fx}} ==Code== ''as of {{fmt/date|2025|12|02}}:'' {{fmt/php/block|1=# // 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();...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

Code

as of 2025-12-02:

#
    // 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;
    }