#community-help

Handling uint64 in Typesense

TLDR JinW inquired about handling uint64 in Typesense. Jason suggested using strings or reducing the granularity of values. Meanwhile, Harrison raised a point about database types.

Powered by Struct AI
8
17mo
Solved
Join the chat
Apr 14, 2022 (17 months ago)
JinW
Photo of md5-be53735a2b0297bb542711c1d2ecea45
JinW
12:12 AM
How do i handle uint64 beside using it as string?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
12:13 AM
Typesense does have an int64 data type. Unless you specifically meant unsigned int 64...
JinW
Photo of md5-be53735a2b0297bb542711c1d2ecea45
JinW
12:13 AM
Yes, unsigned uint64
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
12:14 AM
Strings would be the only way at the moment, for integers larger than (signed) int64
12:15
Jason
12:15 AM
Could you open a feature request on Github issues along with your use case for this?
12:16
Jason
12:16 AM
Or another work-around I can think of is reducing the granularity/precision of the values so they fit in int64
JinW
Photo of md5-be53735a2b0297bb542711c1d2ecea45
JinW
12:27 AM
Thanks, I was just making sure, We use uint64 for our primary id in our database and don't really have a use case for it.
Harrison
Photo of md5-43a35158b04c9c49110114370dbeae06
Harrison
08:03 AM
interesting, what database? Normally they tend to be signed integer either explicitly or implicitly