
JSON Columns and Schema Drift and How to Find It Early
Measure schema drift in a jsonb column with key counts and type counts, see how it changes a sum, and stop it with a NOT VALID check constraint.
Tag
52 posts

Measure schema drift in a jsonb column with key counts and type counts, see how it changes a sum, and stop it with a NOT VALID check constraint.

Capture every row an import refuses, with its line, column and reason, in a form a person can fix and replay. A DuckDB example with real reject tables.

Replace a page of upload rules with a ready template: built-in formats, dropdowns, an example row, a stable link and a note on what the file is for.

Reject Excel files that do not match the template in a way senders can act on: staged checks, stable codes, specific messages, quarantine and a retry path.

Version Excel template layouts so the loader recognizes old files: a version cell, compatible changes, migration rules, a support window and a changelog.

Give notes, comments and instructions their own place in an import template so the data sheet stays a clean table, and make the loader ignore strays.

Map Excel template columns to database types: text for identifiers, real dates, fixed-decimal numbers, flags and lists, with validation and checks.

Name sheets and columns in Excel templates so code and databases can use them: lowercase snake case, no punctuation, stable keys, label mapping.

Why import templates need one header row and no merged cells, how to detect both in code, and how to repair files that arrive with titles and merged headings.

Describe a dataset in YAML, render a Markdown table from it and compare it with the live table to catch columns added or dropped without a doc.

Design Excel templates that load into a database without cleanup: one header row, machine names, typed columns, a notes sheet, versions and rejection rules.

Which schema changes break old producers and old consumers: a tested compatibility matrix, open versus closed objects, version numbers and a CI check.