Hello everyone,
I recently submitted a PR (#18582) that enhances the flexibility of the CharField
length in the SQLite backend by allowing it to be used without explicitly specifying a max_length
. This change simplifies development and testing with SQLite, aligning it more closely with PostgreSQL, which already supports this flexibility.
I wanted to initiate a discussion around whether similar flexibility could be introduced for other databases such as MySQL, MariaDB, and Oracle. According to feedback from the PR reviewers, MySQL and MariaDB still require explicit length limits, and while Oracle supports up to 32,767 characters, it too requires an explicit length limit. Currently, it seems that only PostgreSQL and SQLite allow CharField
usage without specifying max_length
.
For instance, in MySQL versions 5.0.3 and later, VARCHAR
fields can support up to 65,535 characters, but still require a defined limit. Would it be possible or practical to introduce more flexible length settings for CharField
in these databases, similar to what PostgreSQL and SQLite offer?
I’d love to hear the community’s thoughts on whether there’s interest in adding more flexibility to CharField
length configurations across other databases. If there’s positive feedback, I’d be open to creating additional tickets and PRs to explore potential solutions.
Thank you in advance for your feedback and advice!