Ferreteria/v0.6/clade/Sys/Data/Engine/aux/Schema

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Data‎ | Engine‎ | aux(Redirected from Ferreteria/v0.6/clade/Sys/Data/Engine/schema/Ops)
Jump to navigation Jump to search
clade: Sys\Data\Engine\aux\Schema
Clade Family
StandardBase Schema MyMar
Clade Aliases
Alias Clade
Action* [c,i] Sys\Events\ItWent
Base* [c,i] Aux\StandardBase
ClientIface Sys\Data\Engine\endpt\Client
EngineIface Sys\Data\Engine
FileIface Sys\FileSys\Node\Fi
Panel* [c,i] IO\O\Panel (i), Panel\Line (c)
QStr* [c,i] Data\Mem\QVar\Str
SelfIface Sys\Data\Engine\aux\Schema
ServerIface Sys\Data\Engine\endpt\Server
Subpages

About

  • Purpose: Schema operations parent-class
  • Requires:
    • database-engine object
    • schema name

History

  • 2025-01-01 started
  • 2025-03-12 added $okToReplace argument to DoImport().
    • I'm still torn about whether that should be passed some other way,
    • but this will work for now.
  • 2025-06-01 moved from [WFe]Sys\Data\aux ⇒ [WFe]Sys\Data\Engine
  • 2025-10-06 Changing this so it is initialized with iConn instead of iOper
  • 2025-11-22 Refactoring schema-management just a bit

Code

as of 2026-02-22 (just after renaming; was working(ish)):

interface iSchema extends BaseIface {
    // DETAILS
    #function OServer() : ServerIface;
    #function OClient() : ClientIface;
    function OEngine() : EngineIface;
    function QSchemaName() : QStrIface;
    function SchemaName() : string;
    // ACTION
    function DoExport(FileIface $ofData) : ActionIface;
    function DoImport(FileIface $ofData, bool $okToReplace) : ActionIface;
}
abstract class caSchema extends BaseClass implements SelfIface {

    // ++ SETUP ++ //

    protected function __construct(){}

    public static function FromEngine(EngineIface $oEng, string $sSchema) {
        $oThis = new static;
        $oThis->oEngine = $oEng;
        $oThis->sSchema = $sSchema;
        return $oThis;
    }

    // 2026-02-06 Is this ever needed? Why?
    #public function OClient() : ClientIface { return $this->oDBC->OOper(); }
    public function QSchemaName() : QStrIface { return QStrClass::FromString($this->sSchema); } // 2025-11-09 Why do we need this?
    public function SchemaName() : string { return $this->sSchema; }

    // -- SETUP -- //
    // ++ OBJECTS ++ //

    private $oEngine;
    public function OEngine() : EngineIface { return $this->oEngine; }

    private $oPanel=NULL;
    protected function OPanel(?PanelIface $o=NULL) : PanelIface { return is_null($o) ? ($this->oPanel ?? $this->oPanel = new PanelClass) : ($this->oPanel = $o); }

    // -- OBJECTS -- //
}