File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,8 +39,10 @@ features = ["trace"]
3939
4040
4141[features ]
42+ default = [" is-valid" ]
4243bundled = [" rusqlite/bundled" ]
4344bundled-sqlcipher = [" rusqlite/bundled-sqlcipher" ]
4445bundled-sqlcipher-vendored-openssl = [
4546 " rusqlite/bundled-sqlcipher-vendored-openssl" ,
4647]
48+ is-valid = []
Original file line number Diff line number Diff line change @@ -161,7 +161,13 @@ impl r2d2::ManageConnection for SqliteConnectionManager {
161161 }
162162
163163 fn is_valid ( & self , conn : & mut Connection ) -> Result < ( ) , Error > {
164- conn. execute_batch ( "SELECT 1;" ) . map_err ( Into :: into)
164+ conn. execute_batch (
165+ #[ cfg( feature = "is-valid" ) ]
166+ "SELECT 1;" , // This query can cause performance issues and also may cause errors on non-standard SQLite implementations.
167+ #[ cfg( not( feature = "is-valid" ) ) ]
168+ "" ,
169+ )
170+ . map_err ( Into :: into)
165171 }
166172
167173 fn has_broken ( & self , _: & mut Connection ) -> bool {
You can’t perform that action at this time.
0 commit comments