Skip to content

Test::DBIC::ExpectedQueries - Test that no unexpected DBIx::Class queries are run

Notifications You must be signed in to change notification settings

jplindstrom/p5-Test-DBIC-ExpectedQueries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 

Repository files navigation

p5-Test-DBIC-ExpectedQueries

NAME

Test::DBIC::ExpectedQueries - Test that no unexpected DBIx::Class queries are run

DESCRIPTION

Ensure that only the DBIx::Class SQL queries you expect are executed while a particular piece of code under test is run.

Avoiding the n+1 problem

When following a relation off a row object it's easy to overlook the fact that it's causing one query for each row in the resultset. This can easily be solved by prefetching those relations, but you have to know it happens first.

This module will help you with that, and to ensure you don't accidentally start running many single row queries in the future.

Details

See Test::DBIC::ExpectedQueries on metacpan.org

About

Test::DBIC::ExpectedQueries - Test that no unexpected DBIx::Class queries are run

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •