Skip to content

Feature: byte_size and char_length#135

Merged
stackmystack merged 5 commits intomasterfrom
sqlite-byte-length
Dec 18, 2025
Merged

Feature: byte_size and char_length#135
stackmystack merged 5 commits intomasterfrom
sqlite-byte-length

Conversation

@stackmystack
Copy link
Copy Markdown
Contributor

The problem with the current implementation of length is that it's unreliable across vendors.

The newly introduced functions will give correct semantics across vendors.

Some details may vary, still, unfortunately: mssql stores by default in UTF-16 and, the author needs to pay close attention to their maths.

Closes #134.

@stackmystack stackmystack changed the title Feature: byte_size and char_length DRAFT: Feature: byte_size and char_length Dec 12, 2025
@stackmystack stackmystack force-pushed the sqlite-byte-length branch 2 times, most recently from b5a7dc3 to 41a4247 Compare December 12, 2025 14:26
@stackmystack stackmystack force-pushed the sqlite-byte-length branch 3 times, most recently from 888c058 to cf13521 Compare December 12, 2025 15:28
Useful for passing config from containers. See previous commit.
@stackmystack stackmystack force-pushed the sqlite-byte-length branch 4 times, most recently from fd46b3a to 45d8ed6 Compare December 12, 2025 16:44
@stackmystack stackmystack changed the title DRAFT: Feature: byte_size and char_length Feature: byte_size and char_length Dec 12, 2025
@stackmystack stackmystack force-pushed the sqlite-byte-length branch 3 times, most recently from 4befe9c to be981cd Compare December 15, 2025 12:21
Comment thread .github/workflows/ruby.yml Outdated
Comment thread NEWS.md Outdated
Comment thread NEWS.md Outdated
`.length` calls were inconsistent across vendors, and it also contained
a bug that didn't return what you expect.

For that reason, we deprecate length, and we ask people to use the more
reliable `.byte_size` and `.char_length` instead.
@stackmystack stackmystack merged commit 5a4de78 into master Dec 18, 2025
371 of 374 checks passed
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.

Support byte_length and char_length

2 participants