Ferreteria/v0.6/clade/Sys/Data/Engine/Oper/MyMar/@fx/DoExport: Difference between revisions

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Data‎ | Engine‎ | Oper‎ | MyMar
Jump to navigation Jump to search
(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();...")
 
No edit summary
 
Line 2: Line 2:
==About==
==About==
* '''General''': {{l/ver/fx}}
* '''General''': {{l/ver/fx}}
* '''Calls''':
** <code>{{l/ver/fx|DoCommand}}()</code>
==Code==
==Code==
''as of {{fmt/date|2025|12|02}}:''
''as of {{fmt/date|2025|12|02}}:''
{{fmt/php/block|1=#
{{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 {
     public function DoExport(string $sSchema, RecvBuffClass $oInBuff) : CommOpIface {
         $oConnDB = $this->OConn();        // DB connection
         $oConnDB = $this->OConn();        // DB connection
         $oSockDB = $oConnDB->OSock();
         $oSockDB = $oConnDB->OSock();
        #echo $oSockDB->ReflectThis()->Report();
         $oConnSh = $oSockDB->OPlug();
         $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
         $sCred = $oConnDB->CredsForCmd(); // DB connection string from DB-local shell


Line 22: Line 18:


         // Send dump command directly to shell, not to DB engine:
         // Send dump command directly to shell, not to DB engine:
        #echo $$oConnSh->ReflectThis()->Report(); die();
         $oAct = $oConnSh->DoCommand($sCmd,$oInBuff,new CommOpClass);
         $oAct = $oConnSh->DoCommand($sCmd,$oInBuff,new CommOpClass);
         return $oAct;
         return $oAct;
     }
     }
}}
}}

Latest revision as of 03:14, 3 December 2025

About

Code

as of 2025-12-02:

#
    public function DoExport(string $sSchema, RecvBuffClass $oInBuff) : CommOpIface {
        $oConnDB = $this->OConn();        // DB connection
        $oSockDB = $oConnDB->OSock();
        $oConnSh = $oSockDB->OPlug();

        $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:
        $oAct = $oConnSh->DoCommand($sCmd,$oInBuff,new CommOpClass);
        return $oAct;
    }