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
The current PDOStatement implementation has two issues with object fetching:
In the fetch() method, while there is a case for PDO::FETCH_OBJ that converts the row to an object using (object) $row, the method's return type is incorrectly typed as array instead of mixed.
In the fetchAll() method, the PDO::FETCH_OBJ case is incorrectly implemented. It's currently returning the raw $allRows array without converting each row to an object:
The fetch() method should have a return type of mixed to properly reflect that it can return objects.
The fetchAll() method should convert each row to an object when PDO::FETCH_OBJ is specified.
Impact
This bug affects any Laravel applications using the libsql driver that expect to receive objects from database queries, which is the default behavior in Laravel. Currently, it requires workarounds like manually casting results to objects or using Laravel's collection methods to handle the conversion.
The text was updated successfully, but these errors were encountered:
The current PDOStatement implementation has two issues with object fetching:
Expected Behavior
Impact
This bug affects any Laravel applications using the libsql driver that expect to receive objects from database queries, which is the default behavior in Laravel. Currently, it requires workarounds like manually casting results to objects or using Laravel's collection methods to handle the conversion.
The text was updated successfully, but these errors were encountered: