Skip to content

docs: document populating NOT NULL columns from bulk procedures - #833

Merged
Hinton merged 3 commits into
mainfrom
docs/sql-bulk-not-null-column
Jul 28, 2026
Merged

docs: document populating NOT NULL columns from bulk procedures#833
Hinton merged 3 commits into
mainfrom
docs/sql-bulk-not-null-column

Conversation

@Hinton

@Hinton Hinton commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

Adds guidance to the SQL code-style doc on keeping a NOT NULL column backwards compatible during a rolling deployment when it is populated through an OPENJSON/TVP bulk procedure.

  • New section Populating a NOT NULL column from a bulk (JSON/TVP) procedure, nested as an ##### sub-section under Adding a column to a table since it continues that section's NOT NULL / backwards-compatibility discussion.
  • Explains why a scalar procedure parameter's default keeps it safe but a JSON/TVP field has no per-field default, so an old server sending a payload that omits the field yields NULL and fails the NOT NULL constraint.
  • Shows the breaking pattern vs. the safe ISNULL([Column], {default}) pattern.

Add guidance under 'Adding a column to a table' on keeping a NOT NULL
column backwards compatible during rolling deployments when it is
populated through an OPENJSON/TVP bulk procedure, using ISNULL at each
insert/update site.
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed a documentation-only change to docs/contributing/code-style/sql.md that adds a new sub-section on keeping a NOT NULL column backwards compatible during rolling deployments when populated via OPENJSON/TVP bulk procedures. The heading nests correctly as ##### under "Adding a column to a table" and precedes the sibling "Changing a column data type" section. The technical explanation (scalar-parameter defaults vs. missing JSON/TVP fields yielding NULL) and the ISNULL([Column], {default}) remediation are accurate and consistent with existing examples in the file.

No findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploying contributing-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: a6afa23
Status: ✅  Deploy successful!
Preview URL: https://d033743a.contributing-docs.pages.dev
Branch Preview URL: https://docs-sql-bulk-not-null-colum.contributing-docs.pages.dev

View logs

@theMickster theMickster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have some improvements to make. Happy to discuss as needed.

Comment thread docs/contributing/code-style/sql.md Outdated
Comment thread docs/contributing/code-style/sql.md Outdated
Comment thread docs/contributing/code-style/sql.md
@Hinton
Hinton requested a review from theMickster July 28, 2026 11:23
@Hinton
Hinton merged commit b2be99e into main Jul 28, 2026
31 checks passed
@Hinton
Hinton deleted the docs/sql-bulk-not-null-column branch July 28, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants