Problems trying to save data locally with SQLite #179
Unanswered
gabinollier
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm trying to use sqlite-net library in order to save data locally on the user's phone, before syning it to Supabase (for offline-usage).
For convenience, I would like to have a single class representing each table, both the SQLite one and the Supabase one :
The problem is that the BaseModel (which I need to inherit from because of Supabase) contains properties like
BaseUrl
,RequestClientOptions
,GetHeaders
,PrimaryKey
, etc. that the SQLite library will try to save, which I obsviously do not want it to, (especially because thePrimaryKey
dictionary keys type is not supported so it throws the following error) :These properties, on the BaseModel, do have a
[Newtonsoft.Json.JsonIgnore]
attribute but the SQLite library ignore that because is seems to useSystem.Text.Json
instead ofNewtonsoft.Json
(regarding to the error above).Do you have any idea of a workaround to do this ? I'm pretty sure adding the attribute
System.Text.Json.Serialization.JsonIgnore
to theBaseModel
properties would fix it but I can't since it's in the Supabase package.I'm not really sure of what i'm doing since I'm new to programming in general. Is this the common way to do "offline-first" applications ?
I also apologise if my English isn't the best, it's not my native language.
Thanks you in advance for any help and have a great day,
Gabin
Beta Was this translation helpful? Give feedback.
All reactions