Returning Your Schema Connection Information

In the event that you need to get the dbi connection info from your application (to know where your model is connected), which is normally stored in your Catalyst::Model::DBIC::Schema (Model/ in this example) config hash, you would use this:

my $dbi_info = $c->model('DB')->schema->storage->connect_info->[0];

Then $dbi_info would contain the string you set connect_info to in Model/, such as "dbi:SQLite:/path/to/my/database.db".

Another method is accessing the configuration directly:

my $dbinfo = $c->config->{"Model::BDB"}->{connect_info}
My tags:
Popular tags:
Powered by Catalyst
Powered by MojoMojo Hosted by Shadowcat - Managed by Nordaaker