(answering my own question)

ilmari on IRC pointed me towards DBIx::Class::Storage::DBI::Oracle::Generic and the connect_call_datetime_setup method. While I can't say for certain that the on_connect_call option goes and finds the correct formatter, the docs say that it Does the Right Thing, i.e. it sets the necessary values and environment variables for DBIx::Class::InflateColumn::DateTime and DateTime::Format::Oracle. It just works.

There is a no-op sub in the base class DBIx::Class::Storage::DBI so that your code is portable across databases. The documentation on on_connect_call explains that on_connect_call => 'datetime_setup' calls DBIx::Class::Storage::DBI::Oracle::Generic->connect_call_datetime_setup() on Oracle databases which makes your InflateColumn call work.

some example code

my $schema = Timetable::Schema->connect("dbi:Oracle:$schema_name", $db_username, $db_password, {on_connect_call => 'datetime_setup'} ); my $resultset = $schema->resultset('Ical') ->search($id); print "Start time is ", $resultset->start_time; # Start time is 2018-04-30T16:00:00
works with
use utf8; package Timetable::Schema::Result::Ical; use base 'DBIx::Class::Core'; __PACKAGE__->load_components("InflateColumn::DateTime"); __PACKAGE__->table_class("DBIx::Class::ResultSource::View"); __PACKAGE__->table("ICAL"); __PACKAGE__->add_columns( "id", { data_type => "varchar2", is_nullable => 0, size => 255 }, "start_time", { data_type => "datetime", is_nullable => 1, original => { data_type => "date" }, }, }; 1;

Ea

Sometimes I can think of 6 impossible LDAP attributes before breakfast.

Mojoconf was great!


In reply to Re: Dbic and inflating Oracle DATE columns - solved by Ea
in thread Dbic and inflating Oracle DATE columns - solved by Ea

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.