I was having difficulty passing connect options through to dbicdump (via Config::Any), e.g trying to dump the schema from an Oracle database requires the following connection options:
However this came up with an error that seemed to suggest these options weren't being used.
DBIx::Class::Schema::Loader::DBI::Oracle::_view_definition(): DBI Exception: DBD::Oracle::db selectrow_array failed: ORA-24345: A Truncation or null fetch error occurred (DBD ERROR: ORA-01406 error on field 1 of 1, ora_type 8, LongReadLen too small and/or LongTruncOk not set)
From the code, it looks like dbicdump allows a config key options within connect_info so I tried:
Can't use string ("LongTrunkOk") as a HASH ref while "strict refs" in use at /cath/homes2/ucbcisi/.plenv/versions/5.12.5/lib/perl5/site_perl/5.12.5/DBIx/Class/Storage/DBI.pm line 733.
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).
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).