Add `pipekit export` / `pipekit apply` (pipekit/config_io.py) to serialise the DB's config — drivers, connections, modules (+ columns, watermarks, hooks), groups, schedules — to a git-trackable text tree under config/, and rehydrate it. SQLite stays runtime state; definitions become diffable/reviewable/ revertible. - config only: run_log/group_run/settings and per-run state columns excluded - name-keyed refs (portable across databases); source_query in .sql sidecars; columns as real JSON arrays for line-by-line diffs - newline-normalised so CRLF-vs-LF is never a spurious change - apply is create/update by name; child collections fully synced; top-level deletes gated behind --prune; --dry-run prints the plan - round-trip is identity (export -> apply --dry-run == nothing to do) Commits the current config/ as the first baseline, capturing the freshly populated columns_json for rm00101/rm00301/iv00101. Documented in SPEC.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
128 lines
3.1 KiB
JSON
128 lines
3.1 KiB
JSON
{
|
|
"name": "ocrs",
|
|
"source_connection": "S78030956",
|
|
"dest_connection": "usmidsap02",
|
|
"dest_table": "cms.ocrs",
|
|
"staging_table": "pipekit_staging.ocrs",
|
|
"merge_strategy": "incremental",
|
|
"merge_key": "fford#",
|
|
"enabled": 1,
|
|
"dest_description": "Order Discounts/Charges 6.0",
|
|
"columns": [
|
|
{
|
|
"source_name": "FFORD#",
|
|
"source_type": "NUMERIC(9,0)",
|
|
"dest_name": "fford#",
|
|
"dest_type": "numeric(9,0)",
|
|
"description": "Customer Order Number"
|
|
},
|
|
{
|
|
"source_name": "FFITM#",
|
|
"source_type": "NUMERIC(3,0)",
|
|
"dest_name": "ffitm#",
|
|
"dest_type": "numeric(3,0)",
|
|
"description": "Item Number"
|
|
},
|
|
{
|
|
"source_name": "FFDIS#",
|
|
"source_type": "NUMERIC(3,0)",
|
|
"dest_name": "ffdis#",
|
|
"dest_type": "numeric(3,0)",
|
|
"description": "Discount Number"
|
|
},
|
|
{
|
|
"source_name": "FFDISC",
|
|
"source_type": "CHAR(3)",
|
|
"dest_name": "ffdisc",
|
|
"dest_type": "text",
|
|
"description": "Discount Code"
|
|
},
|
|
{
|
|
"source_name": "FFDDES",
|
|
"source_type": "CHAR(30)",
|
|
"dest_name": "ffddes",
|
|
"dest_type": "text",
|
|
"description": "Discount Description"
|
|
},
|
|
{
|
|
"source_name": "FFDRCR",
|
|
"source_type": "CHAR(1)",
|
|
"dest_name": "ffdrcr",
|
|
"dest_type": "text",
|
|
"description": "Debit Credit"
|
|
},
|
|
{
|
|
"source_name": "FFBANT",
|
|
"source_type": "CHAR(1)",
|
|
"dest_name": "ffbant",
|
|
"dest_type": "text",
|
|
"description": "Rate Base"
|
|
},
|
|
{
|
|
"source_name": "FFPERC",
|
|
"source_type": "NUMERIC(8,5)",
|
|
"dest_name": "ffperc",
|
|
"dest_type": "numeric(8,5)",
|
|
"description": "Discount Percent"
|
|
},
|
|
{
|
|
"source_name": "FFDAMT",
|
|
"source_type": "NUMERIC(13,5)",
|
|
"dest_name": "ffdamt",
|
|
"dest_type": "numeric(13,5)",
|
|
"description": "Discount Amount"
|
|
},
|
|
{
|
|
"source_name": "FFAPER",
|
|
"source_type": "CHAR(1)",
|
|
"dest_name": "ffaper",
|
|
"dest_type": "text",
|
|
"description": "Fixed or per Unit"
|
|
},
|
|
{
|
|
"source_name": "FFDEXT",
|
|
"source_type": "NUMERIC(10,2)",
|
|
"dest_name": "ffdext",
|
|
"dest_type": "numeric(10,2)",
|
|
"description": "Discount Extension"
|
|
},
|
|
{
|
|
"source_name": "FFAUNT",
|
|
"source_type": "CHAR(3)",
|
|
"dest_name": "ffaunt",
|
|
"dest_type": "text",
|
|
"description": "Amount Per-Unit"
|
|
},
|
|
{
|
|
"source_name": "FFRTEF",
|
|
"source_type": "CHAR(1)",
|
|
"dest_name": "ffrtef",
|
|
"dest_type": "text",
|
|
"description": "Rate Flag"
|
|
},
|
|
{
|
|
"source_name": "FFRNDD",
|
|
"source_type": "NUMERIC(2,0)",
|
|
"dest_name": "ffrndd",
|
|
"dest_type": "numeric(2,0)",
|
|
"description": "Rounding # of Decimals"
|
|
},
|
|
{
|
|
"source_name": "FFAPLY",
|
|
"source_type": "CHAR(1)",
|
|
"dest_name": "ffaply",
|
|
"dest_type": "text",
|
|
"description": "Fixed Discount Applied"
|
|
}
|
|
],
|
|
"watermarks": [
|
|
{
|
|
"name": "ocrs_wm",
|
|
"connection": "usmidsap02",
|
|
"resolver_sql": "SELECT COALESCE(MAX(dcudat), DATE '1900-01-01') - 7 FROM cms.ocrh",
|
|
"default_value": null
|
|
}
|
|
],
|
|
"hooks": []
|
|
}
|