Ferreteria/v0.6/clade/Sys/Data/Engine/Oper: Difference between revisions

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Data‎ | Engine
Jump to navigation Jump to search
No edit summary
No edit summary
Line 19: Line 19:
| '''Action*''' || {{l/ver/clade|Sys\Events|ItWent}} (i)
| '''Action*''' || {{l/ver/clade|Sys\Events|ItWent}} (i)
|-
|-
| '''AdminReq*''' || {{l/ver/clade|Sys\Data\reqs\Engine|AdminRq}} (i)
| '''AdminReq*''' || {{l/ver/clade|Sys\Data\Engine\aux\ActionRq|AdminRq}} (i)
|-
|-
| '''Base*''' || {{l/ver/clade|IO|Aspect}} (c,i)
| '''Base*''' || {{l/ver/clade|IO|Aspect}} (c,i)
|-
|-
| '''BkupMode*''' || {{l/ver/clade|Sys\Data\reqs\Engine\AdminRq\aux|FileFormat}} (e)
| '''BkupMode*''' || {{l/ver/clade|Sys\Data\Engine\aux\ActionRq\Admin\aux|FileFormat}} (e)
|-
|-
| '''DataReq*''' || {{l/ver/clade|Sys\Data\reqs\Engine|CommRq}} (i)
| '''DataReq*''' || {{l/ver/clade|Sys\Data\Engine\aux|CommRq}} (i)
|-
|-
| '''HasRost*''' || {{l/ver/clade|Config\Roster\for|AClass}} (i,t)
| '''HasRost*''' || {{l/ver/clade|Config\Roster\for|AClass}} (i,t)
Line 38: Line 38:
* '''Purpose''': engine-agnostic objects for doing ''operations'' on a {{l/ver/clade|Sys\Data|Engine|Database Engine}}
* '''Purpose''': engine-agnostic objects for doing ''operations'' on a {{l/ver/clade|Sys\Data|Engine|Database Engine}}
** This mainly descends from the {{l/ver/clade|IO|Aspect|I/O Aspect}} clade. The other major aspect of {{l/ver/clade|Sys\Data|Engine|Database}} management is the {{l/ver/clade|Sys/Data/Engine|Conn|Engine Connection}} clade, which handles the mechanics of ''connecting'' from the [[Ferreteria]] client code to the database server, wherever it may be, and handling I/O therewith.
** This mainly descends from the {{l/ver/clade|IO|Aspect|I/O Aspect}} clade. The other major aspect of {{l/ver/clade|Sys\Data|Engine|Database}} management is the {{l/ver/clade|Sys/Data/Engine|Conn|Engine Connection}} clade, which handles the mechanics of ''connecting'' from the [[Ferreteria]] client code to the database server, wherever it may be, and handling I/O therewith.
==Functions==
==Code==
{{fmt/php/block|1=
{{fmt/php/block|1=
interface iOps extends BaseIface, HasRostIface {
     // ACTION: requests
     // ACTION: requests
     function DoDataRequest(DataReqIface $oReq);
     function DoDataRequest(DataReqIface $oReq);
Line 49: Line 50:
     // INFO
     // INFO
     function ConnSlug() : string;  // connection shortname
     function ConnSlug() : string;  // connection shortname
}
abstract class caOps extends BaseClass implements SelfIface {
    use HasRostTrait;
    // ++ CONFIG ++ //
    abstract protected function CommOpClass() : string;
    abstract protected function SchemaClass() : string;
    abstract protected function ScribeClass() : string;
    // -- CONFIG -- //
    // ++ SETUP ++ //
    protected function __construct() {}
    // USAGE: Only call if constructing to pass to a Conn object's constructor
    static public function ForConn() : iOps {
        $oThis = new static;
        return $oThis;
    }
    static public function FromConn(ConnIface $oConn) : iOps {
        $oThis = new static;
        $oThis->WithConn($oConn);
        return $oThis;
    }
    // ++ SETUP: dynamic ++ //
    private $oConn=NULL;
    public function WithConn(ConnIface $oConn) : void {
        $this->oConn = $oConn;
        #$this->RegisterThis();
    }
    protected function OConn() : ConnIface { return $this->oConn; }
    // -- SETUP -- //
    // ++ OBJECTS ++ //
    // TODO: Rename to OSchema()
    public function GetSchema(string $sName) : SchemaIface { return new ($this->SchemaClass())($this,$sName); }
    // -- OBJECTS -- //
    // ++ INFO ++ //
    public function ConnSlug() : string { return $this->OConn()->ObjectSlug(); }
    // -- INFO -- //
    // ++ UI ++ //
    // UNPROMPT
    public function DescribeInline() : string { return $this->OConn()->DescribeInline(); }  // sometimes not needed
    // -- UI -- //
}
}}
}}

Revision as of 01:40, 5 October 2025

clade: Sys\Data\Engine\Oper
Clade Family

Aspect
AClass

Ops

MyMar

Aliases
alias clade
Action* ItWent (i)
AdminReq* AdminRq (i)
Base* Aspect (c,i)
BkupMode* FileFormat (e)
DataReq* CommRq (i)
HasRost* AClass (i,t)
Schema* Schema (i)
Schemas* Schemas (i)

About

  • Purpose: engine-agnostic objects for doing operations on a Database Engine
    • This mainly descends from the I/O Aspect clade. The other major aspect of Database management is the Engine Connection clade, which handles the mechanics of connecting from the Ferreteria client code to the database server, wherever it may be, and handling I/O therewith.

Code

interface iOps extends BaseIface, HasRostIface {
    // ACTION: requests
    function DoDataRequest(DataReqIface $oReq);
    // ACTION: parameterized
    function SchemaList() : SchemasIface;
    function DoUserSetup();
    // OBJECTS
    function GetSchema(string $sName) : SchemaIface;
    // INFO
    function ConnSlug() : string;   // connection shortname
}
abstract class caOps extends BaseClass implements SelfIface {
    use HasRostTrait;

    // ++ CONFIG ++ //

    abstract protected function CommOpClass() : string;
    abstract protected function SchemaClass() : string;
    abstract protected function ScribeClass() : string;

    // -- CONFIG -- //
    // ++ SETUP ++ //

    protected function __construct() {}

    // USAGE: Only call if constructing to pass to a Conn object's constructor
    static public function ForConn() : iOps {
        $oThis = new static;
        return $oThis;
    }
    static public function FromConn(ConnIface $oConn) : iOps {
        $oThis = new static;
        $oThis->WithConn($oConn);
        return $oThis;
    }

    // ++ SETUP: dynamic ++ //

    private $oConn=NULL;
    public function WithConn(ConnIface $oConn) : void {
        $this->oConn = $oConn;
        #$this->RegisterThis();
    }
    protected function OConn() : ConnIface { return $this->oConn; }

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

    // TODO: Rename to OSchema()
    public function GetSchema(string $sName) : SchemaIface { return new ($this->SchemaClass())($this,$sName); }

    // -- OBJECTS -- //
    // ++ INFO ++ //

    public function ConnSlug() : string { return $this->OConn()->ObjectSlug(); }

    // -- INFO -- //
    // ++ UI ++ //

    // UNPROMPT
    public function DescribeInline() : string { return $this->OConn()->DescribeInline(); }  // sometimes not needed

    // -- UI -- //
}