Skip to content

Add encodeImmutable for generated columns - #5

Open
kryptus36 wants to merge 1 commit into
mainfrom
immutable-encode
Open

Add encodeImmutable for generated columns#5
kryptus36 wants to merge 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>
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