diff --git a/SeaORM/docs/04-generate-entity/03-column-types.md b/SeaORM/docs/04-generate-entity/03-column-types.md index 1c02885ae44..91bdad80c89 100644 --- a/SeaORM/docs/04-generate-entity/03-column-types.md +++ b/SeaORM/docs/04-generate-entity/03-column-types.md @@ -23,12 +23,14 @@ For the mappings of Rust primitive data types: | `i32` | Integer | integer | int | integer | | `u32` | Unsigned | integer | int unsigned | N/A | | `i64` | BigInteger | integer | bigint | bigint | -| `u64` | BigUnsigned | integer | bigint unsigned | N/A | +| `u64` | BigUnsigned | unsupported[^u64-sqlite] | bigint unsigned | N/A | | `f32` | Float | float | float | real | | `f64` | Double | double | double | double precision | | `bool` | Boolean | boolean | bool | bool | | `Vec` | Binary | blob | blob | bytea | +[^u64-sqlite]: `u64` is not supported on SQLite. SQLite stores only 64-bit *signed* integers, and the underlying `sqlx` SQLite driver does not encode `u64` (values above `i64::MAX` cannot be represented). Use `i64`, or store large unsigned values as `String` / `Vec`. See [#1400](https://github.com/SeaQL/sea-orm/issues/1400). + For the mappings of Rust non-primitive data types. You can check [`entity/prelude.rs`](https://github.com/SeaQL/sea-orm/blob/master/src/entity/prelude.rs) for all of the reexported types. | Rust type | Database Type
([`ColumnType`](https://docs.rs/sea-orm/2.0.0/sea_orm/entity/enum.ColumnType.html)) | SQLite
datatype | MySQL
datatype | PostgreSQL
datatype | diff --git a/SeaORM/i18n/zh-CN/docusaurus-plugin-content-docs/current/04-generate-entity/03-column-types.md b/SeaORM/i18n/zh-CN/docusaurus-plugin-content-docs/current/04-generate-entity/03-column-types.md index 53936fe8641..22d77d262ba 100644 --- a/SeaORM/i18n/zh-CN/docusaurus-plugin-content-docs/current/04-generate-entity/03-column-types.md +++ b/SeaORM/i18n/zh-CN/docusaurus-plugin-content-docs/current/04-generate-entity/03-column-types.md @@ -23,12 +23,14 @@ Rust 基本数据类型的映射: | `i32` | Integer | integer | int | integer | | `u32` | Unsigned | integer | int unsigned | N/A | | `i64` | BigInteger | integer | bigint | bigint | -| `u64` | BigUnsigned | integer | bigint unsigned | N/A | +| `u64` | BigUnsigned | 不支持[^u64-sqlite] | bigint unsigned | N/A | | `f32` | Float | float | float | real | | `f64` | Double | double | double | double precision | | `bool` | Boolean | boolean | bool | bool | | `Vec` | Binary | blob | blob | bytea | +[^u64-sqlite]: SQLite 不支持 `u64`。SQLite 仅存储 64 位*有符号*整数,且底层 `sqlx` SQLite 驱动无法编码 `u64`(无法表示大于 `i64::MAX` 的值)。请改用 `i64`,或将较大的无符号值存储为 `String` / `Vec`。参见 [#1400](https://github.com/SeaQL/sea-orm/issues/1400)。 + Rust 非基本数据类型的映射。你可以查看 [`entity/prelude.rs`](https://github.com/SeaQL/sea-orm/blob/master/src/entity/prelude.rs) 了解所有重新导出的类型。 | Rust type | Database Type
([`ColumnType`](https://docs.rs/sea-orm/2.0.0-rc.25/sea_orm/entity/enum.ColumnType.html)) | SQLite
datatype | MySQL
datatype | PostgreSQL
datatype |