Skip to content

Add encodeImmutable for generated columns - #5

Merged
kryptus36 merged 1 commit into
mainfrom
immutable-encode
Sep 1, 2026
Merged

Add encodeImmutable for generated columns#5
kryptus36 merged 1 commit into
mainfrom
immutable-encode

Conversation

@kryptus36

Copy link
Copy Markdown
Collaborator

Table-backed encode stays STABLE because it reads the blocklist. Reject negative and NULL numbers instead of hanging in toId.

Supersedes #3
Fixes #4

Looking for feedback on the idea of encodeImmutable being added on for generated columns, but leaving encode as stable and matching sqids implementation.

Added tests for immutable, negative number blocking.

If feedback is positive, I'll merge.

Table-backed encode stays STABLE because it reads the blocklist. Reject
negative and NULL numbers instead of hanging in toId.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kryptus36
kryptus36 merged commit 6bf1504 into main Sep 1, 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.

encode() enters infinite loop / high CPU utilisation on negative integer input

1 participant