oxidecomputer / async-bb8-diesel

Safe asynchronous access to Diesel and the bb8 connection manager
MIT License
12 stars 8 forks source link

Use has_broken as a is_valid check function #57

Open jarnura opened 11 months ago

jarnura commented 11 months ago

bb8::ConnectionManager has is_valid and has_broken methods. In make_pooled, there is no option to use has_broken.

Introducing a feature flag called use_has_broken_as_valid_check, with this feature flag, the is_valid method of bb8::ConnectionManager uses the has_broken method of r2d2's ManageConnection.

For Diesel, the has_broken method uses the is_broken method of Diesel Connection. 'Select 1' can be avoided for every get from the connection pool.