Files
MemRelay/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/PostgreSQL 数据库操作必须带 catalog.md
T
memrelay 49f0d4e503 create: PostgreSQL 数据库操作必须带 catalog
MemRelay-Operation: memory-save:exp-pg-catalog-every-operation-20261111
MemRelay-Resource: 6e1edb3c-5940-47a0-a53c-c16ff4bbd996
2026-11-11 02:45:22 +08:00

1.2 KiB
Raw Blame History

title, type, permalink, stable_id, scope, memory_type, project_id, usage_profile_id, status, revision, request_id, created_at, updated_at, tags
title type permalink stable_id scope memory_type project_id usage_profile_id status revision request_id created_at updated_at tags
PostgreSQL 数据库操作必须带 catalog experience main/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/postgre-sql-数据库操作必须带-catalog 6e1edb3c-5940-47a0-a53c-c16ff4bbd996 project experience d5a7f581-c442-4554-87b9-ee723b8b0258 0c9feb46-d06e-43cd-9ef0-c5813c84a998 active 1 exp-pg-catalog-every-operation-20261111 2026-11-10T18:45:19.933980+00:00 2026-11-10T18:45:19.933980+00:00
database
postgresql
mysql

数据库管理里 PostgreSQL 一个连接下有多个库(catalog),树结构是 catalog > schema > 表。任何会连接数据库的接口都要把 catalog 传到 DatabaseService._runtime / ExternalDatabase,否则会连到连接的默认库,表现为「SQL 执行失败」。新增请求模型继承 schemas.CatalogScoped;GET/DELETE 接口加 catalog 查询参数;前端用 tab.catalog 或 selectedCatalog。catalog 只在 create_external_engine 的 PostgreSQL 分支生效,MySQL/MariaDB 传空或任意值都被忽略。改动后用 METRIX_TEST_PG_URL 和 METRIX_TEST_MYSQL_URL 指向临时容器跑在线测试。