How to connect to the DB with DBIx::Class without repeating connection details? : https://metacpan.org/pod/distribution/DBIx-Class/lib/DBIx/Class/Manual/Intro.pod suggest to connect to the DB as the following:

    my $schema = MyApp::Schema->connect(...);

explicitly providing the connection details such as the password.

However I want to connect to the same database from different scripts. It would be unwise to provide the password in each of the scripts again and again.

So my question: What is the "official" way to create a connection method with fixed connection details?

I realize that I can write something like:

    package MyApp::Schema;
    use base qw/DBIx::Class::Schema/;

    sub my_connect {
      $_[0]::SUPER->connect(...);
    }

    1;

But is this the right "official" way to do this?

I realize that providing another connection details may be useful for testing scripts, but in the reality we do not (yet) use testing scripts, so this is largely irrelevant for out team.