You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Postgre][Entity] cast boolean in entity from PostgreSQL is always true #7483
changed the title [-]Bug: cast boolean in entity from PostgreSQL is always true[/-][+]Bug: [Entity] cast boolean in entity from PostgreSQL is always true[/+]on Jun 6, 2023
No. I think this is not a bug. The current implementation does not support PostgreSQL bool type.
Supporting it needs an enhancement.
If you need it, try to send a PR to 4.4 branch.
@iRedds What do you mean? You think adding PostgreBooleanCast is better?
I think it is better that BooleanCast supports PostgreSQL boolean type column if possible.
@kenjis But Entity is not part of the database layer. And the desired result can be obtained through a getter or custom type casting.
Now, if we didn’t have the opportunity to get the desired result, then this would be a missing function.
changed the title [-]Bug: [Entity] cast boolean in entity from PostgreSQL is always true[/-][+][Entity] cast boolean in entity from PostgreSQL is always true[/+]on Jan 31, 2024
changed the title [-][Entity] cast boolean in entity from PostgreSQL is always true[/-][+][Postgre][Entity] cast boolean in entity from PostgreSQL is always true[/+]on Feb 5, 2024
Activity
shishamo commentedon Jun 6, 2023
@kenjis is there any update to that issue?
[-]Bug: cast boolean in entity from PostgreSQL is always true[/-][+]Bug: [Entity] cast boolean in entity from PostgreSQL is always true[/+]kenjis commentedon Jun 6, 2023
No. I think this is not a bug. The current implementation does not support PostgreSQL bool type.
Supporting it needs an enhancement.
If you need it, try to send a PR to
4.4branch.iRedds commentedon Jun 6, 2023
You can extend the BooleanCast class and cast the type you need.
@kenjis Entity is a representation of data and is not directly related to the DBMS. I don't think this is a good solution.
kenjis commentedon Jun 6, 2023
@iRedds What do you mean? You think adding
PostgreBooleanCastis better?I think it is better that
BooleanCastsupports PostgreSQL boolean type column if possible.shishamo commentedon Jun 6, 2023
Actually this is what i have done in my own extended cast.
But i was wondering why it is not handled by CI by default because the Postgre driver exists
iRedds commentedon Jun 6, 2023
@kenjis I think it should be left as is.
kenjis commentedon Jun 6, 2023
@iRedds CI4 supports PostgreSQL but the Entity cannot support boolean type column.
Isn't it a missing feature?
iRedds commentedon Jun 6, 2023
@kenjis But Entity is not part of the database layer. And the desired result can be obtained through a getter or custom type casting.
Now, if we didn’t have the opportunity to get the desired result, then this would be a missing function.
[-]Bug: [Entity] cast boolean in entity from PostgreSQL is always true[/-][+][Entity] cast boolean in entity from PostgreSQL is always true[/+]kenjis commentedon Feb 5, 2024
#8243 would solve this issue.
[-][Entity] cast boolean in entity from PostgreSQL is always true[/-][+][Postgre][Entity] cast boolean in entity from PostgreSQL is always true[/+]shishamo commentedon Feb 8, 2024
Thank you @kenjis ~
michalsn commentedon Feb 19, 2026
Last comment 2 years ago. We can assume that casting in the model should be used instead.