Open General4077 opened 6 months ago
Thanks for reporting this, @General4077, we'll take a look soon and determine next steps.
Hey @General4077 ! At the moment, we're not prioritizing adding significant support for types. With that said, your solution could be merged if you:
For context, we're pushing hard to get our beta release out right now, and trying to avoid significant feature changes in the back end while we do that.
Improved support for PostgreSQL types is a high priority after the beta release.
I've moved this to the "beta" milestone, but we'll be happy to accept a PR from you anytime @General4077.
@kgodey @mathemancer I'd be happy to try and get something in on this
Thank you @General4077!
Description
Connecting mathesar to a pre-existing postgres database with custom enumerations causes an unspecified error when loading tables. Running the Production config with the DEBUG flag on (I know this isn't realistic but I was poking around) an AssertionError is raised when serializing the offending column.
Expected behavior
Tables should load in with the Enumerations or a detailed error message should be raised.
To Reproduce
Connect mathesar to a postgres database with custom enumerations
Environment
Workaround (Very ugly bandaid)
I'm sure this larger than just ENUMs and probably extends to all custom types in postgres but for my use case I just patched
db/columns/base.py:MathesarColumn.db_type
property to default to atext
type if no valid type was found.This mostly works but doesn't understand the enum and provides no usable feedback for invalid inputs. Updating a row: Inserting a row:
Additional context
I looked through several issues looking to see if this was already discussed and I'm not sure if it ties in with the higher level discussion in issue 403
This sounds like an issue the maintainers would want to address but I work with python and have passing familiarity with django if there's a direction for a more permanent solution I'd be happy to put some time towards that.