Skip to content
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

SqliteCompiler - Issue when using Unique Identifier #635

Open
kapilbhavsar opened this issue Nov 10, 2022 · 1 comment
Open

SqliteCompiler - Issue when using Unique Identifier #635

kapilbhavsar opened this issue Nov 10, 2022 · 1 comment

Comments

@kapilbhavsar
Copy link

kapilbhavsar commented Nov 10, 2022

The query generated by SqliteCompiler for a table with UUID, the parameters are treated as string.
But the sqlite db stores UUID as blob so the strings needs to be passed as X'3E9FDFCAFF7B3B4AB2065C63BC4609C4' instead of '3E9FDFCAFF7B3B4AB2065C63BC4609C4'.
SqliteCompiler doesn't appends X and the query returns with no result.

This further creates problems when using Include or IncludeMany. If the primary and foreign keys are UniqueIdentifier the Include function does not works.

https://stackoverflow.com/questions/7815587/using-guid-in-sqlite-select-where-guid-is-stored-in-the-sqlite-db-as-binaries

@kapilbhavsar
Copy link
Author

kapilbhavsar commented Nov 11, 2022

I was using postgresql and one more thing I noticed with Include ..
In the handleIncludes method of QueryFactory class, you are converting all the local keys to string
var localIds = dynamicResult.Where(x => x[include.LocalKey] != null) .Select(x => x[include.LocalKey].ToString()) .ToList();
So all the parameters are passed as string which again gives error 42883: operator does not exist: uuid = text.
It works if I remove ToString.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant