Use hashref (not hash) for connection info options #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trying to specify DBI connection options in dbicdump config.
I may have misunderstood usage, but it looks like connect allows DBI connection options to be given as a hashref, eg
However, I think
dbicdump
is currently passing them in as a (de-referenced) hash:This PR changes
%{$options}
to$options
, which allows DBI connection options to be specified in the config as:Full details appended.
I was having difficulty passing connect options through to
dbicdump
(viaConfig::Any
), e.g trying to dump the schema from an Oracle database requires the following connection options:Based on the DBIx::Class::Storage::DBI docs, I thought the best way to do this in
dbic.conf
was:However this came up with an error that seemed to suggest these options weren't being used.
From the code, it looks like dbicdump allows a config key
options
withinconnect_info
so I tried:However, this gave the error:
It looks like
DBIC->connect
can accept these options as a hashref, but dbicdump is currently passing them in as a (de-referenced) hash. Applying the change in this PR seemed to make everything work for me.Existing tests all pass. I've added a test to make sure the new config with options parses okay (fails prior to this PR). It currently throws out a warning though (I think because the test database isn't DBD::Oracle).