ulong support #3445
ulong support
#3445
-
Hi guys, i got a small Discord bot currently using LiteDB for its database. I'm in the process of migrating to RealmDB but i found out that it doesn't support ULong64 (which is used by everywhere by discord) so i would like to know if Realm will support this. Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
fealebenpae
Sep 17, 2023
Replies: 1 comment 4 replies
-
There are no immediate plans to support this, but since partial class MyModel : IRealmObject
{
[MapTo(nameof(Value))] // MapTo is useful for .Filter queries where you're writing a query string by hand
private long ValueLong { get; set; }
public ulong Value
{
get => (ulong)ValueLong;
set => ValueLong = (long)value;
}
// This is needed if you're using change notifications to be notified that the remapped property has changed.
partial void OnPropertyChanged(string? propertyName)
{
if (propertyName == nameof(ValueLong))
{
RaisePropertyChanged(nameof(Value));
}
}
} |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Realm doesn’t natively support unsigned integers, so Realm Studio interprets the field as a signed integer.
You could use the
decimal
type for your field which is big enough to contain an UInt64 without having to reinterpret it and should visualize correctly in Studio, I believe.