# sqlalchemy.exc.CompileError: Unsupported type: <class 'sqlalchemy.dialects.postgresql.JSONB'>. Cannot compile this type.

- **ID:** `python/sqlalchemy-unknown-type`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

使用的数据库方言不支持 JSONB 类型，或未正确导入。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.4.x | active | — | — |
| 2.0.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   确保使用 PostgreSQL 数据库，并从 sqlalchemy.dialects.postgresql 导入 JSONB。
   ```
2. **** (85% success)
   ```
   对于其他数据库，使用 JSON 类型，例如：from sqlalchemy import JSON
   ```

## Dead Ends

- **** — 改用 Text 类型，但丢失了 JSON 的查询能力。 (60% fail)
- **** — 尝试在 MySQL 中使用 JSONB，但 MySQL 不支持该类型。 (80% fail)
