New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #14094 -- Added support for unlimited models.CharField on PostgreSQL. #16302
Conversation
d0e3439
to
29ccd92
Compare
Just a query, on the ticket there was [a mention of |
@carltongibson I didn't, I wasn't aware of this Django feature until just now nor what Joe meant by "much smoother" (faster? less code complexity? etc.). I have just tested it in a dummy Django project and the result is incorrect Django code ( Thanks for the heads up! |
29ccd92
to
0cdbf3d
Compare
@carltongibson it should work now, I am not exactly happy with the implementation (it assumes that a negative |
I could define a constant in the backend's instropection class e.g. |
0cdbf3d
to
9dc403c
Compare
Rebased on top of the changes introduced by #16368, some tests are failing but the test that fails seems unrelated to my changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Elkasitu Thanks for this patch 👍 Please check my comments.
Also, a release note in the |
a04101e
to
ae0b972
Compare
@felixxm I believe I've addressed all of your concerns now, there's one test failing but it seems like it fails randomly (previously it had failed on 3.11 and passed on 3.8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Elkasitu Thanks 👍
@charettes Do you want to take a look?
ae0b972
to
1f74bb8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Elkasitu Thanks for updates 👍
I pushed small edits and fixed CharField.description
.
django/db/backends/base/features.py
Outdated
@@ -340,6 +340,9 @@ class BaseDatabaseFeatures: | |||
# Set to (exception, message) if null characters in text are disallowed. | |||
prohibits_null_characters_in_text_exception = None | |||
|
|||
# Does the backend support unlimited VARCHAR columns? | |||
supports_unlimited_varchar = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supports_unlimited_varchar = False | |
supports_unlimited_charfield = False |
1f74bb8
to
7998e57
Compare
7998e57
to
55746ba
Compare
…eSQL. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
55746ba
to
7eee1dc
Compare
This commit introduced a new database feature flag
supports_unlimited_varchar
which denotes which database backendssupport defining
VARCHAR
columns with no/unlimited size.When this feature flag is enabled for a given backend, CharField
definitions may rely on the default
max_length
value ofNone
insteadof having to explicitly define one. It is however still possible to
explicitly pass a
max_length
and this will be enforced at the databaselevel.
This commit also implemented the necessary changes for the feature to
apply to the postgres backend.