Test::...anager(3pm)

πŸ’– Test::DBIx::Class::SchemaManager β€” the Test::...anager(3pm) glow-up πŸ’–

okay so bestie, real talk: this is a page from the User Contributed Perl Documentation, section 3pm, and the module at the centre of it all is Test::DBIx::Class::SchemaManager. say it with me now. it's a mouthful but it slays. πŸŽ€


✨ NAME ✨

Test::DBIx::Class::SchemaManager β€” it manages a DBIx::Class::SchemaManager for testing. that's the whole job description and it does it beautifully. πŸ’…


🌸 DESCRIPTION 🌸

so this class is a lil helper for Test::DBIx::Class. basically it's a type of wrapper, or adaptor if you wanna be fancy, for your schema β€” so we can more easily and more quickly deploy it and clean it up, all for the purposes of automated testing. it's giving backstage crew energy: never on stage, keeps the whole show running. πŸ¦‹

ngl, you shouldn't need to use anything here. fr fr. however, we do define %ENV variables that you might be interested in using β€” although it's probably best to define inline configuration, or use a configuration file. do with that information what you will, i'm not your mom. 😭

πŸ‘‘ FORCE_DROP_TABLE

set it to a true value and it will force dropping tables in the deploy phase. iconic, right? except β€” it will generate warnings in a database (like sqlite) that can't detect if a table exists before attempting to drop it. so it's a little messy in some places. safe for Mysql though. πŸ’€

🫢 KEEP_DB

usually, at the end of tests, we clean up your database and remove all the tables created, etc. sometimes though you might want to preserve the database after testing so you can 'poke around'. personally, i think it's better to write tests for the poking β€” but sometimes you just need a quick look, and honestly? valid.

PLEASE NOTE: KEEP_DB is not intended for use as a way to preserve deployed databases across tests or test runs. i realize you may wish to try this as a way to reduce testing time, since starting and deploying databases can be time consuming β€” however, it negates the goal we have to properly isolate the test cases. no cap, this one matters. 🚨

if there is tremendous need for this type of feature, we may in the future try to develop a good working system. for now, i recommend using the "reset_schema" β€” see "reset_schema" in Test::DBIx::Class for more β€” and subtests if you want to try this for a given test run. bestie, that's the move. ✨


πŸ”₯ SEE ALSO πŸ”₯

the following modules or resources may be of interest:

  • DBIx::Class
  • Test::DBIx::Class

πŸ’œ AUTHOR πŸ’œ

John Napiorkowski "<jjnapiork@cpan.org>" β€” the legend, the icon, the moment. πŸ‘‘


Copyright 2009, John Napiorkowski "<jjnapiork@cpan.org>"

this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay. ⭐


and that's the whole page, bestie! this one came to you courtesy of perl v5.36.0, dated 2023-01-29, filed under Test::...anager(3pm) in the User Contributed Perl Documentation. go forth and deploy schemas responsibly. mwah. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from