2026/03/09

From Woozle Writes Code
Jump to navigation Jump to search
Monday, March 9, 2026 (#68)
Sunday Monday Tuesday posts:prev <this> next

how Canals work

What happens currently:

  • In the DoCommand() for both Local and SSH2:
    • The Canals object ($oCables) is created with CanalsClass::FromVoid(). (CanalsClass = IO\Aspect\Connx\aux\A\cCanals)
  • In Local, each of the possible Streams which might have been assigned to the Command are checked. Each one found is paired in a Cable-object ($oCable) with the appropriate process stream, and that $oCable is then added to $oCables.
  • In SSH2, only the Command's Listener stream is checked.
    • My first thought was "this may be why exports are working and imports are not", but actually the only testing I've done on imports is with a local DB, which would use Local::DoCommand -- so that can't be it.
    • My next guess is that the Command object is being configured with the necessary streams by the exporter-code but not by the importer-code.
  • Q1: (a) Where does the exporter-code do this, and (b) where should the importer-code do it?
    • A1a: in Engine/aux/Schema/MyMar::ExportToStream() (called from DoExport()).
      • DoExport() is, in turn, called from Engine/aux/ActionRq/Admin/dbase/EngDbExport::Go(), which loops through all schemas and calls DoExport() on each of them.
        • Side note: I think I keep getting schemas confused with tables and/or databases. I feel like there needs to be a more technical/specific word for "collection of schemas", since "database" is often overloaded in colloquial usage.
    • A1b: I think we need Engine/aux/Schema/MyMar::ImportFromStream(), unless I'm just confused again.
      • We do in fact already have Engine/aux/Schema/MyMar::DoImport.
        • ...which itself was being called from Go() in DBA's caEngScImport-descendant, rather than from caEngScImport itself. I have moved Go() up into caEngScImport, for consistency.

Further tidying for consistency:

  • Move the meat of caEngDbExport's Schema-loop into caEngScExport, or else get rid of caEngScExport (currently just empty declarations) and resolve the inconsistency this creates with caEngScImport.

17:00

It turns out "the meat of caEngDbExport's Schema-loop" is already spun out to DoExport(). This makes me think that maybe caEngScExport and caEngScImport don't actually need to exist? Or are they still necessary for the podling-classes, somehow?

17:41

  • caEngScExport is definitely redundant; I've commented it out.
  • caEngScImport is a little trickier, because it has a Go() function now (recently moved from its DBA-podling, see above). I'm pretty sure this can be moved to Schema, but there are loose threads to tidy up at both ends...

19:29

The non-parallelism, and some of my confusion, arises from the fact that DoExport() applies to both an entire database-connection and individual schemas, while DoImport() only implies to one schema at a time (simply because I don't (yet?) have any use-cases where I'd want to import multiple schemas with a single command).

20:34

Changes: