You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue
Closes #114
背景(Situation)
PostgreSQL 允许多个 schema 使用同一个表名。
db_query_table_exists原先只按数据库和表名查询,无法确认调用方需要的tenant_a.users,与表列表、表描述和代码生成路径的 schema 契约不一致。任务(Task)
为存在性检查增加可选 PostgreSQL schema,同时保持 MySQL、SQLite 现有行为和成功响应的 JSON 可解析性。
行动(Action)
schema。table_schema = %s条件。schema,未提供时为null。验证(Result)
PYTHONPATH=src python -m pytest -q tests/unit:658 passed。python -m ruff check src tests:通过。ruff format --check:通过。git diff --check:通过。实验与边界
使用 PostgreSQL stub 分别执行未提供 schema 与
tenant_a两种输入:前者参数为("app", "users"),后者为("app", "users", "tenant_a"),schema 值始终通过参数传递,不进入 SQL 文本。未建立可比运行时性能基准,性能数据未测量,不作性能提升结论。MySQL 使用 database 作为 schema,SQLite 没有 schema 过滤,均保持原查询路径。