-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Binary Guid Handling with sqlite-net #284
Labels
Comments
Any update on this one? |
Sorry no updates - most people store the guids as text. But I would not be opposed to a StoreGuidAsBytes option PR. |
gentledepp
pushed a commit
to Opti-Q/sqlite-net
that referenced
this issue
Apr 18, 2020
gentledepp
pushed a commit
to Opti-Q/sqlite-net
that referenced
this issue
Apr 18, 2020
…r backward compatibility
gentledepp
pushed a commit
to Opti-Q/sqlite-net
that referenced
this issue
Apr 18, 2020
so.. second try with our PR that solved this 2 years ago. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have been working with a Windows Store app that relies on a Sqlite database.
The Guids are stored in the database in binary form.
In code, I am using the sqlite-net library to access the database.
However, sqlite-net by default, treats Guids as they are stored in string format.
What I am doing right now:
I am modifying:
https://github.com/praeclarum/sqlite-net/blob/master/src/SQLite.cs#L2238
to:
var byteArray = ((Guid)value).ToByteArray();
SQLite3.BindBlob(stmt, index, byteArray, byteArray.Length, NegativePointer);
and:
https://github.com/praeclarum/sqlite-net/blob/master/src/SQLite.cs#L2304
to:
var text = SQLite3.ColumnByteArray(stmt, index);//var text = SQLite3.ColumnString(stmt, index);
Is this the right way? Or I am missing some configuration tweak that might be done to the connection string.
If there is no support right now for such feature, I would be happy to implement it.
The text was updated successfully, but these errors were encountered: