Inferring schemas when you don't have the data
Notes from building LLM-assisted schema-only inference for document-to-relational migration.
databases · LLMs · systems · 1 min read
Most migration tools assume you can inspect the documents. Sometimes you can't—you only have metadata, and you still need a relational model that won't fall apart in production.
At Oracle I worked on schema-only inference for the JSON-to-Duality Migrator: using LLMs to propose primary keys and merge entities that looked different but meant the same thing, then validating those choices with structural guardrails and SQL.
The interesting part wasn't the model call. It was the surrounding system—heuristics that kept the output honest, checks that rejected structurally bad mappings, and measurements that told us whether we were actually reducing table sprawl and improving deduplication.
A few things I took away:
- Models propose; systems decide. Guardrails aren't optional when the output becomes a database schema.
- Measure the migration, not the prompt. Table count, dedup ratio, and coverage matter more than a clever demo.
- Metadata is a product surface. If inference only works on perfect inputs, it doesn't work.
I'm still thinking about how far this pattern goes—AI as a careful assistant inside infrastructure, not a replacement for correctness.