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
my ($user) = $self->_user_rset(username=>$username, $options)->all;
DBIx::Class::ResultSet::single() claims to avoid creating a cursor if there's only one result. Since we only keep one result anyway, would it be worth using single() for speed? If not, would you please let me know the details for my own understanding?
Alternatively, would my $user = ...->first improve code clarity?
Thanks for considering this request!
The text was updated successfully, but these errors were encountered:
It would certainly improve the readability of the code. The query should only yield one result, otherwise your database structure / data is somewhat questionable. @cxw42 thanks for the hint.
Thank you for this module, which is working well for me! Looking at the source, I noticed that the user search is generally
my ($user) = ...->all()
:Dancer2-Plugin-Auth-Extensible-Provider-DBIC/lib/Dancer2/Plugin/Auth/Extensible/Provider/DBIC.pm
Line 603 in 5296ad3
Dancer2-Plugin-Auth-Extensible-Provider-DBIC/lib/Dancer2/Plugin/Auth/Extensible/Provider/DBIC.pm
Line 667 in 5296ad3
Dancer2-Plugin-Auth-Extensible-Provider-DBIC/lib/Dancer2/Plugin/Auth/Extensible/Provider/DBIC.pm
Line 690 in 5296ad3
Dancer2-Plugin-Auth-Extensible-Provider-DBIC/lib/Dancer2/Plugin/Auth/Extensible/Provider/DBIC.pm
Line 718 in 5296ad3
Dancer2-Plugin-Auth-Extensible-Provider-DBIC/lib/Dancer2/Plugin/Auth/Extensible/Provider/DBIC.pm
Line 802 in 5296ad3
DBIx::Class::ResultSet::single() claims to avoid creating a cursor if there's only one result. Since we only keep one result anyway, would it be worth using single() for speed? If not, would you please let me know the details for my own understanding?
Alternatively, would
my $user = ...->first
improve code clarity?Thanks for considering this request!
The text was updated successfully, but these errors were encountered: