This is the error message if you try to Turbosql a u64:
SQLite cannot natively store unsigned 64-bit integers, so Turbosql does not support u64 fields. Use i64, u32, f64, or a string or binary format instead.
rusqlite provides an interesting feature i128_blob:
i128_blob allows storing values of type i128 type in SQLite databases. Internally, the data is stored as a 16 byte big-endian blob, with the most significant bit flipped, which allows ordering and comparison between different blobs storing i128s to work as expected.
So it would be possible to support i128_blob in Turbosql too, and support u64 mapped in this same way to a SQLite BLOB. This would definitely have to be gated behind an opt-in feature (u64_i128_as_blob?) to make clear that these two primitive numeric datatypes in Rust will behave differently than the others from SQLite's perspective. (BLOB serial type code vs an integer serial type code: https://sqlite.org/fileformat.html#record_format ) This would also affect any external software that might want to read the data from the .sqlite file.
This is the error message if you try to Turbosql a
u64
:rusqlite
provides an interesting featurei128_blob
:So it would be possible to support
i128_blob
in Turbosql too, and supportu64
mapped in this same way to a SQLiteBLOB
. This would definitely have to be gated behind an opt-in feature (u64_i128_as_blob
?) to make clear that these two primitive numeric datatypes in Rust will behave differently than the others from SQLite's perspective. (BLOB
serial type code vs an integer serial type code: https://sqlite.org/fileformat.html#record_format ) This would also affect any external software that might want to read the data from the.sqlite
file.