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::ClassTest::DBIx::Class
π AUTHOR π
John Napiorkowski "<jjnapiork@cpan.org>" β the legend, the icon, the moment. π
π COPYRIGHT & LICENSE π
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
- debian bookworm: libtest-dbix-class-perl 0.52-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtest-dbix-class-perl 0.52-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtest-dbix-class-perl 0.52-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtest-dbix-class-perl 0.52-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtest-dbix-class-perl 0.52-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms