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:
parent
d7e5f2fec7
commit
4f45fe6037
11 changed files with 446 additions and 5 deletions
3
examples/ingest-golden-sql/expected-bundle/index.md
Normal file
3
examples/ingest-golden-sql/expected-bundle/index.md
Normal 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)
|
||||
15
examples/ingest-golden-sql/expected-bundle/ingest-costs.md
Normal file
15
examples/ingest-golden-sql/expected-bundle/ingest-costs.md
Normal 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 |
|
||||
14
examples/ingest-golden-sql/expected-bundle/ingest-meta.md
Normal file
14
examples/ingest-golden-sql/expected-bundle/ingest-meta.md
Normal 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 |
|
||||
BIN
examples/ingest-golden-sql/fixture/portefolje.sqlite
Normal file
BIN
examples/ingest-golden-sql/fixture/portefolje.sqlite
Normal file
Binary file not shown.
1
examples/ingest-golden-sql/ingested-at.txt
Normal file
1
examples/ingest-golden-sql/ingested-at.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
2026-07-04T12:00:00Z
|
||||
21
examples/ingest-golden-sql/manifest.json
Normal file
21
examples/ingest-golden-sql/manifest.json
Normal 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
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue