-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
Handle BOOLEAN
data type in the backend
#387
Comments
We should double-check that the strings we cast to boolean are what we want. We're currently restricting what gets cast from the PostgreSQL default to only |
It seems like we should at least accept the Postgres default values of It would also be nice to ensure that any column that we're recommending to be |
At the moment, it's not possible to accomplish this combination of goals with our current inference functions, or the paradigm under which they work together. Please recall that we decided to stay away from trying to infer column type based on global attributes for the moment (such as "the column has only two non-null values"). We could change that, but it's a major overhaul of the entire inference system we currently have set up, and would be a large(ish) time investment. Alternatively, we could hack together a "one-off" solution just for Booleans, but I'd rather come up with a type inference setup that's global-property-aware in general. |
@mathemancer I remember now, I'll set up a separate issue for overhauling our type inference setup to be global-property-aware (probably post-MVP). Edited to add: here's the new issue #438 |
@powellc Checking in to see if you have any questions. |
Nope. Got a lot of clarity on how the type system works from Brent. Will dig into this later today. Thanks @kgodey |
Juist a quick update here. I finally got my head around the API design and basics of adding and updating things and have implemented the ability to alter a column type to Boolean. This utilizes some functions that already existsed so it was really just turning on the feature in the The I'm going to add some tests for the column altering and open a PR today. |
Sounds good, @powellc! |
This commit adds the ability to use a PATCH command against the `/tables/<id>/` endpoint with a payload of: `{"columns": [{"name": "col_name", "type": "BOOLEAN"}]}` which will alter the column type for `col_name` to Boolean if the values in that row support a conversion to Boolean.
This commit adds the ability to use a PATCH command against the `/tables/<id>/` endpoint with a payload of: `{"columns": [{"name": "col_name", "type": "BOOLEAN"}]}` which will alter the column type for `col_name` to Boolean if the values in that row support a conversion to Boolean.
This commit adds the ability to use a PATCH command against the `/tables/<id>/` endpoint with a payload of: `{"columns": [{"name": "col_name", "type": "BOOLEAN"}]}` which will alter the column type for `col_name` to Boolean if the values in that row support a conversion to Boolean.
This commit adds the ability to use a PATCH command against the `/tables/<id>/` endpoint with a payload of: `{"columns": [{"name": "col_name", "type": "BOOLEAN"}]}` which will alter the column type for `col_name` to Boolean if the values in that row support a conversion to Boolean.
Moving this back to |
@kgodey may I close this with your work work on the |
@powellc I think it would be good to add some |
@kgodey sounds good! I'll work on that this evening. |
This issue is to ensure that Mathesar can handle the Postgres
BOOLEAN
data type.As part of this issue, we need to ensure that:
BOOLEAN
if it's possible to do so.BOOLEAN
when it makes sense to do so.Most of this is already implemented, this issue is to review the current implementation, ensure it works, and see if we can make improvements to it.
Additional Context
v0/databases/
's types list to show both Mathesar and DB type information. #368 for code that calculates which types are allowed for a column.The text was updated successfully, but these errors were encountered: