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

.Include and .IncludeMany does not work with Guid keys in Postgres databases #311

Open
ldias91 opened this issue Oct 23, 2019 · 5 comments

Comments

@ldias91
Copy link

ldias91 commented Oct 23, 2019

Hi,

When i use include method in postgres database with primary keys as guid i get the following error:

operator does not exist: uuid = text

I think the problem is here

.Select(x => x[include.LocalKey].ToString())

instead of
.Select(x => x[include.LocalKey].ToString())

may be
.Select(x => x[include.LocalKey]);

@chrisgate
Copy link

Do u have workaround for Include in Postgresql?

@ahmad-moussawi
Copy link
Contributor

Yes that's true, can you make a PR for it?

@bpasha7
Copy link

bpasha7 commented May 6, 2021

Hi @ahmad-moussawi,
I try to use Include feature, see example

db.Query("environment").Where("siteenvironmentid", UserEnvironmentId).IncludeMany("Organizations", db.Query("organization"), "environmentid", "siteenvironmentid");

it generates this sql statements
SELECT * FROM "environment" WHERE "siteenvironmentid" = 1
SELECT * FROM "organization" WHERE "environmentid" IN ('1')

So it does not work because the second SELECT converts integers to strings
Is it bug or I do something wrong?
Thanks

@bsekin-jb
Copy link

there is a pr about that issue (see #494), why you don't merge this pr to solve this issue?

@andrewweitzer
Copy link

andrewweitzer commented Mar 7, 2024

Would love if this gets solved

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

6 participants