Skip to content

fix(pg-delta): normalize function body line endings#276

Closed
pjpjq wants to merge 1 commit into
supabase:mainfrom
pjpjq:codex/normalize-function-line-endings
Closed

fix(pg-delta): normalize function body line endings#276
pjpjq wants to merge 1 commit into
supabase:mainfrom
pjpjq:codex/normalize-function-line-endings

Conversation

@pjpjq

@pjpjq pjpjq commented Jun 7, 2026

Copy link
Copy Markdown

Summary

  • Normalize CRLF/LF differences in source_code, sql_body, and definition when building the procedure stable snapshot.
  • Reuse the same line-ending normalization for body-only non-alterable comparisons to avoid false CREATE OR REPLACE FUNCTION diffs.
  • Add regression coverage showing line-ending-only differences do not produce a diff while owner-only changes are still detected.

Fixes #242.

Tests

  • bun test packages/pg-delta/src/core/objects/procedure/procedure.diff.test.ts
  • cd packages/pg-delta && bun run check-types
  • cd packages/pg-delta && bun run format-and-lint

@changeset-bot

changeset-bot Bot commented Jun 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0f16e20

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@avallete avallete closed this Jun 8, 2026
@pjpjq pjpjq changed the title fix(pg-delta): 规范化函数体换行符比较 fix(pg-delta): normalize function body line endings Jun 9, 2026
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.

pg-delta treats CRLF vs LF inside function bodies as a schema diff

2 participants