-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Model strict: false is ignored with Postgre SQL repository #4042
Model strict: false is ignored with Postgre SQL repository #4042
Comments
@shreking-around please share a minimal app reproducing the problem, so we can take a look at it. |
I don't think that we support Table Per Hierarchy Inheritance in LoopBack. Your Why is the behavior different with MongoDB? MongoDB is an object database that support free-form models, therefore additional properties are correctly written to & retrieved from the database. There is one thing I find surprising and slightly annoying: the data is discarded silently, the framework does not print any warnings about unsupported |
Thank you for clarifying the issue. Do I understand it correctly that strict: true mode is "hardcoded" in the connector or is it possible to change it via datasource configuration? |
Yes, In |
Discussion in the estimation meeting:
|
Hello,
I have a problem with class inheritance and repository using Postgre SQL.
Let's say we have Animal parent class and then Dog and Chicken child classes. I store them in one table (Table Per Hierarchy Inheritance) called animal.
In LB4 App I have Animal base model (entityType is a discriminator):
and child class dog
When I query a dog from the repository barkingLevel is ommited on output though the strict is set to false.
This will return animal (not a dog) without barkingLevel .
Repository:
Expected result: Returned animal from repository should include extra properties from dog since the strict setting is set to false.
Current result: Only properties belonging to parent class are returned.
NOTE: If I do the same thing in Mongo DB, everything works as expected.
Thank you.
Acceptance criteria
See #4042 (comment)
The text was updated successfully, but these errors were encountered: