-
-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
u64 unsupported by sqlx-sqlite #1400
Comments
Possible workaround might be to store u64s as a BLOB in sqlite, though as of now this still seems to raise the same "u64 unsupported" error message |
We might want to backport SeaQL/sea-query#556 to sea-query 0.28 |
SQLx's SQLite driver doesn't support
|
As a temporary "fix" before a consensus has been reached, I'm going to update the docs. |
Hi @billy1624, I would like to give the second option a shot. But I am afraid that I may need some hand holding to properly fix it
|
Hey @matdexir, sorry for the misinformation.
This isn't ideal. A better option would be "encode & decode
We only need to change the decoding logics in SeaORM. Which is located at: Lines 331 to 335 in d8a2428
So, we want to get an Similar to this code snippet: Lines 455 to 470 in d8a2428
A test case on SeaORM side would be perfect. Where we try saving and select a model with an |
Basically what I was thinking as well, since the former solution would result in memory/value loss. I know that we also lose out almost on about half of the values present in u64 by using i64 but the use cases for such big numbers are quite rare. Regarding the implementation, I was wondering, should I introduce a new block of with a structure similar for u32/f64 Lines 486 to 528 in d8a2428
But instead more like this: impl TryGetable for u64 However I think that this may be too overkill. Lines 138 to 146 in d8a2428
Which would look like: impl TryGetable for Option<i64> What do you think? Very Thankful for your assistance~~ |
I think the above idea of encoding u64 as i64 will be great, had an idea to do this. range of u64 is [0 to 2^64 - 1] when we save value to database When we load value from database NOTE: The down point with this approach is values in database are not exactly what uses wants, it needs to be decoded to be used. |
|
Description
Using a u64 in the field of a database model yields the error
u64 unsupported by sqlx-sqlite
when used with the sqlite backend, even though the docs seems to suggest that u64's are supported.Steps to Reproduce
Use a database model containing a u64 with a sqlite-based backend.
Expected Behavior
Either no error to occur - or more likely, the docs to reflect the fact that u64s aren't supported in sqlite (see: launchbadge/sqlx#2284 (comment))
Actual Behavior
panicked at 'u64 unsupported by sqlx-sqlite'
Reproduces How Often
Reproducible 100% of the time
Versions
Additional Information
The text was updated successfully, but these errors were encountered: