{
  "id": "python/sqlalchemy-missing-async-driver",
  "signature": "sqlalchemy.exc.ArgumentError: The asyncio extension requires an async driver to be used. The 'sqlite' driver is not async.",
  "signature_zh": "sqlalchemy.exc.ArgumentError: asyncio 扩展需要使用异步驱动程序。'sqlite' 驱动程序不是异步的。",
  "regex": "sqlalchemy\\.exc\\.ArgumentError:\\ The\\ asyncio\\ extension\\ requires\\ an\\ async\\ driver\\ to\\ be\\ used\\.\\ The\\ 'sqlite'\\ driver\\ is\\ not\\ async\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Using SQLAlchemy's async extension with a synchronous database driver, such as sqlite3 or psycopg2.",
  "root_cause_type": "generic",
  "root_cause_zh": "在 SQLAlchemy 的异步扩展中使用了同步数据库驱动，如 sqlite3 或 psycopg2。",
  "versions": [
    {
      "version": "1.4.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "2.0.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "create_engine doesn't accept an async parameter; you must use create_async_engine.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The driver must be installed separately; otherwise ImportError occurs.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Use create_async_engine with an async driver: from sqlalchemy.ext.asyncio import create_async_engine; engine = create_async_engine('postgresql+asyncpg://user:pass@localhost/db')",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "For SQLite, use aiosqlite: engine = create_async_engine('sqlite+aiosqlite:///foo.db')",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}