# 绑定参数 0 时出错 - 可能是不支持的类型。

- **ID:** `python/sqlalchemy-exc-interface-error-cursor-closed`
- **领域:** python
- **类别:** type_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

传递了一个无法转换为数据库兼容类型的 Python 对象（例如，没有适当类型适配的自定义类实例）。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **Convert to supported type** (90% 成功率)
   ```
   Convert the value to a supported type like int, float, str, or datetime before passing to the query.
   ```
2. **Register custom adapter** (80% 成功率)
   ```
   Register a custom type adapter using sqlite3.register_adapter() for custom classes.
   ```

## 无效尝试

- **Converting to string blindly** —  (50% 失败率)
- **Retrying without type fix** —  (90% 失败率)
