Skip to content

sqlite package: package scoped db variable instead of injection #18

Answered by benbjohnson
youdzinn asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Eugene,

The downside to using a global db variable in your package is that it can make testing problematic. Especially if you want to parallelize tests to speed them up. I generally try to avoid global variables because it makes it more difficult to change code and reuse code over time.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@youdzinn
Comment options

Answer selected by benbjohnson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants