metabase_ingest

Featured

Convert Metabase questions, models, and metrics into ktx Semantic Layer source definitions. Covers result-metadata to KSL column type mapping, FK/PK detection, near-duplicate deduplication, pre-aggregation decomposition, join-graph connectivity, and how to react to priorProvenance from earlier ingest syncs. Load when the WorkUnit contains `cards/<id>.json` files under a Metabase bundle.

AI & Automation 1,511 stars 96 forks Updated 1 weeks ago Apache-2.0

Install

View on GitHub

Quality Score: 94/100

Stars 20%
100
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Metabase to ktx Semantic Layer Each WorkUnit represents one Metabase collection's cards for one Metabase database (mapped to exactly one ktx connection). Every `cards/<id>.json` file carries the resolved SQL, result_metadata, card type, collection path, and referenced-card ids. The WU's `sync-config.json` tells you which sync mode is active and which selections apply. `databases/<id>.json` tells you the target ktx connection. ## Context format Each card JSON looks like: ```json { "metabaseId": 7, "name": "Daily orders", "description": "Orders by day", "type": "model", "databaseId": 42, "collectionId": 5, "resolvedSql": "SELECT ...", "templateTags": [{"name": "ref", "type": "card", "cardReference": 10}], "resultMetadata": [ {"name": "day", "base_type": "type/DateTime", "semantic_type": "type/CreationTimestamp"}, {"name": "order_count", "base_type": "type/Integer"} ], "collectionPath": ["Data", "Orders Team"], "referencedCardIds": [10] } ``` Use `resultMetadata` to: - Map `base_type` to KSL column type: `type/Integer`, `type/Float`, `type/Decimal`, `type/BigInteger` → `number`; `type/Text`, `type/TextLike` → `string`; `type/DateTime`, `type/Date`, `type/DateTimeWithTZ` → `time`; `type/Boolean` → `boolean`. - Identify grain candidates: columns with `semantic_type: type/PK`. - Identify join candidates: columns with `semantic_type: type/FK` plus `fk_target_field_id`. - Identify time columns: `semantic_type: type/CreationTimestamp` or `type/Upd...

Details

Author
Kaelio
Repository
Kaelio/ktx
Created
2 months ago
Last Updated
1 weeks ago
Language
TypeScript
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category