test(ingest): SQL connector + load-bearing + golden, detach-proven (I4)

New: test_ingest_sql.py (connector mechanics + typed rendering + dispatch), test_ingest_sql_loadbearing.py (SQL seams: typed-NULL, typed-REAL, navigability via unchanged okf), test_ingest_golden_sql.py + examples/ingest-golden-sql/ (byte-frozen sqlite golden; NULL->empty, 4200.0->4200.0 and escape discriminate a typed impl from naive ones). Updated: sql-source refusal test repointed to http (I6); manifest schema-breadth comment. Each new seam proven RED at its detach point.

Refs: shared/ingest-spec.md 11 golden + load-bearing table
This commit is contained in:
Kjell Tore Guttormsen 2026-07-04 06:56:02 +02:00
commit 4f45fe6037
11 changed files with 446 additions and 5 deletions

View file

@ -0,0 +1,3 @@
Golden extraction case: two SQL extracts from a local project database (sql source type).
- [Project costs](ingest-costs.md)
- [Catalogue metadata](ingest-meta.md)

View file

@ -0,0 +1,15 @@
---
type: dataset
title: Project costs
source_system: portefolje-db
source_query: SELECT id, item, amount, note FROM costs ORDER BY id
ingested_at: 2026-07-04T12:00:00Z
ingest_manifest: manifest@a4b891aea55df97b
generated: true
---
| id | item | amount | note |
| --- | --- | --- | --- |
| 1 | LED-armatur | 1200.5 | godkjent |
| 2 | sensor | 89.9 | |
| 3 | kabel | 4200.0 | rest |

View file

@ -0,0 +1,14 @@
---
type: reference
title: Catalogue metadata
source_system: portefolje-db
source_query: SELECT k, v FROM meta ORDER BY k
ingested_at: 2026-07-04T12:00:00Z
ingest_manifest: manifest@a4b891aea55df97b
generated: true
---
| k | v |
| --- | --- |
| owner | anlegg \| drift |
| path | c:\\temp |

Binary file not shown.

View file

@ -0,0 +1 @@
2026-07-04T12:00:00Z

View file

@ -0,0 +1,21 @@
{
"manifest_version": 1,
"source": {"type": "sql", "id": "portefolje-db", "connection_ref": "PORTEFOLJE_SQL_DSN"},
"bundle_summary": "Golden extraction case: two SQL extracts from a local project database (sql source type).",
"extractions": [
{
"id": "costs",
"title": "Project costs",
"query": "SELECT id, item, amount, note FROM costs ORDER BY id",
"okf_type": "dataset",
"max_rows": 10
},
{
"id": "meta",
"title": "Catalogue metadata",
"query": "SELECT k, v FROM meta ORDER BY k",
"okf_type": "reference",
"max_rows": 10
}
]
}