Documentation
¶
Overview ¶
Package dbimport runs one-off data imports into a database Egg's own container: pg_dump of an external Postgres source piped into the container's local psql, via docker exec. The data (and the source credential) never leave the host: the dump streams straight into the target inside its container.
Imports run ASYNCHRONOUSLY (a dump and restore can take minutes and must not block the reconcile tick). Ensure kicks off a detached import the first time it sees an import id, then returns incremental progress on every subsequent tick, which the agent ships to the control plane on the status endpoint.
British English throughout. No em dashes. The source URL and its password are redacted from the import log before it leaves the host.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Importer ¶
type Importer struct {
// contains filtered or unexported fields
}
Importer tracks in-flight imports, one per import id.
func (*Importer) Ensure ¶
func (im *Importer) Ensure(ctx context.Context, containerID string, d *contract.ImportDirective, sourceURL string) (done bool, report *contract.ImportReport)
Ensure starts the import for d.ImportID against the given running container the first time it is seen, then returns incremental progress on every call. Idempotent and cheap: once a job exists it just returns the log delta and current status. sourceURL is the external Postgres connection string; it is redacted from the log and passed to docker exec via the environment, never as a command argument.