What I do is to have my app's database initialization code create two (structurally) identical databases, appname and appname_test. My tests are then written to run against appname_test, which shouldn't have anything else using it, so there's no concern that I might clobber meaningful data. This also allows the tests to use the same connection information (modulo appending a _test to the db name) and credentials as the real app, which both simplifies things and will also cause the tests to catch any problems that may come up with connecting to the db in the first place.
As far as the MySQL vs. SQLite concerns, I get the impression that you're only including SQLite for testing purposes and using MySQL for the real app. If this is accurate, then I'd say to drop SQLite. Tests work best when they're running as much of the same code as the real app as possible and setting up a duplicate _test db allows them to safely use the exact same db handling code.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.