Missing validation for new table's name
Describe the bug When creating a table the dashboard does not validate the length of the new table's name and it causes the metadata request to fail because the table was created with a shortened name.
To Reproduce Steps to reproduce the behavior:
- Go to one of your projects' database page
- Click on the New table button
- Add a very looooooooooooooooooooooooooooooong name for the new table
- Finish creating the table
- Click on save
- See the following error:
Error: Inconsistent object: no such table/view exists in source: "a_very_loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_table_naaaaaaaaaaaaaaaame"
Expected behavior The form should validate the length of the table's name and should show an error and prevent the table from being created.
Screenshots
Additional context Also the error message is pushing out the clear button from the error box.
Payload when creating the table:
{
"args": [
{
"type": "run_sql",
"args": {
"cascade": true,
"read_only": false,
"source": "default",
"sql": "CREATE TABLE public.a_very_loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_table_naaaaaaaaaaaaaaaame (id uuid NOT NULL, PRIMARY KEY (id));"
}
}
],
"type": "bulk",
"version": 1
}
Payload for metadata request:
{
"args": [
{
"args": {
"source": "default",
"table": {
"schema": "public",
"name": "a_very_loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_table_naaaaaaaaaaaaaaaame"
}
},
"type": "pg_track_table"
}
],
"type": "bulk",
"source": "default",
"version": 1
}
Can I work on this issue??
Hi, @yash15-exe! Feel free to start working on it and let me know if you need anything.
@robertkasza Sure
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.