feat: exclude temporary schemas from list_schemas query (#39)

This commit is contained in:
skyler 2026-04-30 19:49:56 +08:00 committed by GitHub
parent b1f4d4c300
commit 23551ffa16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -52,6 +52,8 @@ pub async fn list_schemas(pool: &PgPool) -> Result<Vec<String>, String> {
let rows: Vec<PgRow> = sqlx::query(
"SELECT schema_name FROM information_schema.schemata \
WHERE schema_name NOT IN ('information_schema', 'pg_catalog', 'pg_toast') \
AND schema_name NOT LIKE 'pg_toast_temp_%' \
AND schema_name NOT LIKE 'pg_temp_%' \
ORDER BY schema_name",
)
.fetch_all(pool)