Skip to content

Provide API functionality for the front end to see all reserved names in a schema #1344

@seancolsen

Description

@seancolsen

Problem

I'll explain with an example...

  • When the user renames a table, we have client-side validation to ensure the table name does not conflict with another table name.

  • Postgres also won't allow a table to have the same name as a constraint. However we don't check to see if the user's desired table name conflicts with a constraint name because doing so would require the front end to know the names of all constraints across all tables which would require one API request per table.

  • Similarly, we don't check for conflicts with table name vs view name.

Solution

  • The front end ideally should have some way of seeing all the reserved top-level names for a given schema, so that we can provide client-side validation to ensure that user-entered names are available when the user is entering a name for a table, view, or constraint.

  • I'm open to considering different API designs to meet these needs.

  • One idea is to create a new endpoint /api/db/v0/names. It would only accept GET requests and would return all the top-level names in the schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: backend approvalThe backend team might not agree on whether this makes sense for the codebaseneeds: frontend approvalThe frontend team might not agree on whether this makes sense for the codebaseneeds: implementation specsWe need clarity on HOW we'll implement it from a technical perspectivetemp: discussThis issue n eeds discussion to resolve - part of the Oct 2025 backlog grooming process.type: enhancementwork: backendRelated to Python, Django, and simple SQL

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions