Skip to content
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

API returns column default value formatted differently from submitted #3716

Open
seancolsen opened this issue Jul 30, 2024 · 1 comment
Open
Labels
needs: requirements The problem is clear and worth solving, but we're not yet sure of the best solution regression restricted: maintainers Only maintainers can resolve this issue type: bug Something isn't working work: backend Related to Python, Django, and simple SQL

Comments

@seancolsen
Copy link
Contributor

Steps to reproduce

  1. Use the front end to set a default value for a text column. In the value field, enter:

    foo bar
    
  2. Observe that the default is set up as expected in PostgreSQL.

  3. Expect the "Default Value" configuration form for the column to display a default value of foo bar, exactly as-entered.

  4. Instead, observe that the default value displayed in the form (as is returned from the API) is:

    'foo bar'::text
    

This bug presents usability problems for users wishing to modify an existing default value.

The default value can be modified, but it must first be extracted from within the text casting expression.

Considerations

I think a proper fix for this bug may require some re-thinking of the API return value schema when fetching columns. I'm not sure we'd be able to fix this while sticking to using a single string here.

@seancolsen seancolsen added needs: requirements The problem is clear and worth solving, but we're not yet sure of the best solution restricted: maintainers Only maintainers can resolve this issue type: bug Something isn't working work: backend Related to Python, Django, and simple SQL labels Jul 30, 2024
@seancolsen seancolsen added this to the Beta milestone Jul 30, 2024
@seancolsen
Copy link
Contributor Author

I've confirmed this is a regression. The bug is not present in Mathesar 0.1.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: requirements The problem is clear and worth solving, but we're not yet sure of the best solution regression restricted: maintainers Only maintainers can resolve this issue type: bug Something isn't working work: backend Related to Python, Django, and simple SQL
Projects
None yet
Development

No branches or pull requests

1 participant