DBIx::C...Sandbox(3)

πŸ“¦ version 0.075, in opensuse-leap 16.0

πŸ’… DBIx::Class::Migration::MySQLSandbox β€” like, the manual page bestie

okay so this is DBIx::Class::Migration::MySQLSandbox(3), from the User Contributed Perl Documentation corner of the world, and she is literally here to hand you a mysql sandbox with zero effort. no cap.


✨ NAME ✨

DBIx::Class::Migration::MySQLSandbox β€” autocreate a mysql sandbox πŸŽ€ (yes that's the whole personality, and honestly? iconic.)


🌸 SYNOPSIS 🌸

use DBIx::Class::Migration;

my $migration = DBIx::Class::Migration->new(
  schema_class=>'Local::Schema',
  db_sandbox_class=>'DBIx::Class::Migration::MySQLSandbox'),

$migration->prepare;
$migration->install;

that's it. that's the vibe. πŸ¦‹


πŸ’– DESCRIPTION πŸ’–

so this module automatically creates a mysql sandbox in your target_dir β€” like, it just does it β€” and you can use it for initial prototyping, development, and demonstration. main character energy for your dev environment, fr fr. πŸ‘‘

if you want this to work, you will need to add Test::mysqld to your Makefile.PL or your dist.ini file, and get that installed properly. non-negotiable bestie.

it also requires that you have MySQL installed locally β€” although MySQL does not need to be running, as long as we can find in $PATH the binary installation. so like, chill, it doesn't have to be live. we just gotta be able to find it. πŸ”

if your copy of MySQL is not installed in a normal location, you might need to locally alter $PATH so that we can find it.

for example, on my Mac, mysqld is located at /usr/local/mysql/bin/mysqld so I could do something like this:

PATH=/usr/local/mysqlbin:$PATH [command]

and alter the $PATH for one time running, or I could change the $PATH permanently by editing my .bashrc file (typically located in $HOME). pick your fighter. πŸ’…

NOTE: you might find installing DBD::mysql to be easier if you edit the $PATH before trying to install it. just a lil tip from me to you. πŸ™ˆ

🧚 the helper scripts 🧚

in addition to the MySQL sandbox, we create three helper scripts β€” start, stop and use β€” which can be used to start, stop and open shell level access to your mysql sandbox. obsessed. 🌟

these helper scripts will be located in a child directory of your target_dir (which defaults to share under your project root directory). like so:

[target_dir]/[schema_class]/bin/[start|stop|use]

if your schema class is MyApp::Schema you should see helper scripts like:

/MyApp-Web
  /lib
    /MyApp
      Schema.pm
      /Schema
        ...
  /share
    /migrations
    /fixtures
    /myapp-schema
      /bin
        start
        stop
        use

look at that little tree. she's beautiful. 🌳✨


🫢 what this actually gives you 🫢

this give you a system for:

  • installing a sandbox locally for development πŸ› οΈ
  • starting and stopping it for use (for example in a web application like one you might create with Catalyst) πŸ”₯
  • and for using it by opening a native mysql shell (such as if you wish to review the database manually, and run native SQL queries) πŸ’€

literally all the bases covered. periodt.


🌈 SEE ALSO 🌈

  • DBIx::Class::Migration
  • DBD::mysql
  • Test::mysqld

go read them, they're giving knowledge. πŸ“šπŸ’œ


⭐ AUTHOR ⭐

see DBIx::Class::Migration for author information. (she's mysterious like that. iykyk.)


see DBIx::Class::Migration for copyright and license information. keep it legal bestie, mwah. πŸ’‹


and that's the whole page!! this cutie is perl v5.42.0, dated 2020-06-03, filed under DBIx::C...Sandbox(3) β€” go forth and sandbox your mysql, you gorgeous nerd. πŸ“πŸ’–πŸ§š

πŸ“¦ where this page comes from