Skip to main content

Module import

Module import 

Source
Expand description

Import functionality for the task-graph database.

Provides methods to import data from a JSON snapshot into the database. Supports multiple import modes:

  • Fresh: Import into an empty database (fails if data exists)
  • Replace: Clear existing project data and import (default with –force)
  • Merge: Add missing items, skip or overwrite existing (future)

Handles foreign key constraints by:

  • Deleting tables in reverse order (children first) when clearing
  • Inserting tables in forward order (parents first) when importing

Rebuilds FTS indexes after import.

Structs§

DryRunResult
Result of a dry-run import preview. Shows what would happen without making any changes.
ImportOptions
Options for controlling import behavior.
ImportResult
Result of an import operation.

Enums§

ImportMode
Import mode determining how to handle existing data.

Functions§

remap_snapshot
Remap all task IDs in a snapshot, generating fresh petname IDs for each task and updating all references (dependencies, attachments, tags, state history).
snapshot_root_task_ids
Extract root task IDs from a snapshot.