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

Query Builder not working with Virtual Entity #5069

Closed
5 tasks done
co-sic opened this issue Jan 4, 2024 · 1 comment
Closed
5 tasks done

Query Builder not working with Virtual Entity #5069

co-sic opened this issue Jan 4, 2024 · 1 comment

Comments

@co-sic
Copy link
Contributor

co-sic commented Jan 4, 2024

Describe the bug

I'm not sure if this is something that is intended to work, so feel free to close this issue if this is out of scope or not intended to work.
I have defined a Virtual entity with an expression and this is working fine if i query it through the entity manager. But if i create a query builder for this entity, it just treats the entity as a DB table and tries to select that (non-exsisten) table, ignoring the expression.
My current use case is, that i have an existing FilterQuery (which is dynamically generated) for a Virtual Entity. I know need to use this FilterQuery inside of the knex query builder for an complex aggregation query.

Reproduction

https://github.com/co-sic/node-mikro-orm-playground

What driver are you using?

@mikro-orm/postgresql

MikroORM version

6.0.0-rc.3

Node.js version

20.9.0

Operating system

No response

Validations

@B4nan
Copy link
Member

B4nan commented Jan 4, 2024

It's not supposed to work this way now, but maybe it could. And if not, we can at least add a validation there.

@B4nan B4nan closed this as completed in 27f0c83 Jan 4, 2024
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

2 participants