{
  "id": "python/sqlalchemy-missing-table-definition",
  "signature": "sqlalchemy.exc.NoSuchTableError: Table 'orders' not found",
  "signature_zh": "sqlalchemy.exc.NoSuchTableError: 表 'orders' 未找到",
  "regex": "sqlalchemy\\.exc\\.NoSuchTableError:\\ Table\\ 'orders'\\ not\\ found",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The ORM model references a table that does not exist in the database, or the metadata is not properly loaded.",
  "root_cause_type": "generic",
  "root_cause_zh": "ORM 模型引用了数据库中不存在的表，或元数据未正确加载。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Manually creating the table with raw SQL",
      "why_fails": "The ORM model may still fail if metadata is not refreshed.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    },
    {
      "action": "Ignoring the error and proceeding",
      "why_fails": "Subsequent queries will fail with the same error.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use Base.metadata.create_all() to create missing tables",
      "success_rate": 0.95,
      "how": "from sqlalchemy.ext.declarative import declarative_base\nBase = declarative_base()\nBase.metadata.create_all(engine)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Load table metadata from the database",
      "success_rate": 0.9,
      "how": "from sqlalchemy import Table, MetaData\nmetadata = MetaData()\norders_table = Table('orders', metadata, autoload_with=engine)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}