8000 Size Text columns in DDL in characters rather than bytes by dominion525 · Pull Request #56 · dominion525/jetdb · GitHub
[go: up one dir, main page]

Skip to content

Size Text columns in DDL in characters rather than bytes - #56

Merged
dominion525 merged 1 commit into
mainfrom
fix/text-length-in-characters
Oct 7, 2026
Merged

dominion525 merged 1 commit into
mainfrom
fix/text-length-in-characters

Conversation

@dominion525
Copy link
Copy Markdown
Owner

Summary

  • Jet4 and later store two bytes a character of Text, but the DDL took the stored size in bytes as the length. A Short Text of 255 characters became TEXT(510) in the Access DDL, past the limit of 255, and VARCHAR(510) in PostgreSQL and MySQL, twice its length; COL_NAME of Table1 in enc_vbaV2000.mdb is one.
  • TableDef gains is_jet3, set by read_table_def. The DDL halves the size of a Text column of Jet4 and later, and keeps it for Jet3, which stores one byte a character. A TableDef built outside the crate needs the new field.
  • The test that expected the size, the package test of jetdb-wasm, and the examples in docs/cli.md and docs/cli.ja.md use the sizes in characters.
  • A test of the Text sizes of Jet4 and later and of Jet3. On all the test databases, only the Text sizes in the PostgreSQL, MySQL and Access DDL of Jet4 and later files change; the SQLite DDL, which writes no size, and the shown schema are the same.

🤖 Generated with Claude Code

- Jet4 and later store two bytes a character of Text, but the DDL took the stored size in bytes as the length, so a column of 255 characters became TEXT(510) or VARCHAR(510), past the limit of 255 of a Short Text in Access and twice the length in the other dialects
- Add is_jet3 to TableDef, set by read_table_def; the DDL halves the size of a Text column of Jet4 and later, and keeps it for Jet3, which stores
8000
 one byte a character
- Update the test that expected the size, the package test, and the examples in docs/cli.md and docs/cli.ja.md
- Add a test of Text sizes of Jet4 and later and of Jet3; on all the test databases only the Text sizes in the PostgreSQL, MySQL and Access DDL of Jet4 and later files change

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dominion525
dominion525 merged commit 991b686 into main Oct 7, 2026
10 checks passed
@dominion525
dominion525 deleted the fix/text-length-in-characters branch October 7, 2026 09:03
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.

1 participant

0