Skip to content

fix: allow public schema in model config and add warning in connection form#7

Merged
wicky-zipstack merged 1 commit into
mainfrom
fix/schema-public-restriction
Mar 25, 2026
Merged

fix: allow public schema in model config and add warning in connection form#7
wicky-zipstack merged 1 commit into
mainfrom
fix/schema-public-restriction

Conversation

@wicky-zipstack
Copy link
Copy Markdown
Contributor

What

  • Remove public / PUBLIC schema exclusion from PostgreSQL and Snowflake list_all_schemas() so it appears in the model configuration schema dropdown
  • Add warning description in connection form schema field advising against using public

Why

  • The public schema was hardcoded as excluded in the backend SQL query, so users could never select it in model configuration — even though it's a valid schema some users legitimately use
  • Meanwhile, the connection form had no validation or warning — users could type public as the default schema without any guidance
  • This inconsistency was confusing: connection form accepts public, but model config hides it

How

PostgreSQL:

  • backend/visitran/adapters/postgres/connection.py — Removed 'public' from the NOT IN clause in list_all_schemas()
  • backend/visitran/adapters/postgres/schema.json — Updated schema field description with recommendation

Snowflake:

  • backend/visitran/adapters/snowflake/connection.py — Removed 'PUBLIC' from the NOT IN clause in list_all_schemas()
  • backend/visitran/adapters/snowflake/schema.json — Updated schema field description with recommendation

Other adapters (DuckDB, Trino, Databricks, BigQuery) were checked — none filter public, no changes needed.

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

  • No breaking changes. Users who don't use public schema see no difference. Users who do use public will now see it in the model config dropdown (previously hidden). The warning in the connection form is informational only — it does not block input.

Database Migrations

  • None

Env Config

  • None

Relevant Docs

  • None

Related Issues or PRs

  • Reported by QA: schema field not validated in connection form, and public schema hidden in model config

Dependencies Versions

  • None

Notes on Testing

  • Create a PostgreSQL connection with public as the schema — verify no error
  • Open model configuration — verify public now appears in the schema dropdown
  • Create a new connection — verify the warning description is visible under the schema field
  • Repeat for Snowflake if available

Screenshots

N/A — backend changes only.

Checklist

  • I have read and understood the Contribution Guidelines.
  • PostgreSQL: public schema exclusion removed
  • Snowflake: PUBLIC schema exclusion removed
  • Connection form descriptions updated with warning
  • Other adapters verified — no changes needed

Copy link
Copy Markdown
Contributor

@tahierhussain tahierhussain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants