[Dbix-class] New DBIx::Class oracle user

Brandon Black blblack at gmail.com
Thu Jun 21 03:07:32 GMT 2007


On 6/20/07, Ben Hitz <hitz at genome.stanford.edu> wrote:
> Hi -
>
> We have a well-developed Oracle database but are refactoring our per
> API for it.  So we are checking out Class::DBI and DBIx::Class (at
> Matt's prompting).
>
> I did get the DBIx::Class::Schema::Loader to work, BUT I had to put
> in a little hack to use "$db_schema.$tablename" instead of $tablename in
> DBIx::Schema::Loader::DBI::Oracle.
>

First off, DBIx::Class::Schema::Loader::DBI::Oracle was actually
written by Tsunoda Kazuya, I just imported his work into the main
distribution (at his request some time ago), so I'm not terribly
familiar with it (or Oracle).

In general, Schema::Loader supports an option "db_schema" that you use
to specify a specific "schema" (in Oracle's sense of the word) to load
table definitions from.  However, the DBI::Oracle driver seems to be
explicitly removing this information from the table names, which is
probably wrong (see the line in there that has a comment above it that
says 'remove "user." (schema) prefixes").  This is quite likely the
culprit.  What happens if you remove that line of code?

Another thing you may want to look at is putting an "on_connect_do"
into the options of your connect_info, which has a command to set the
current schema to whatever you like.  See the docs for this in
DBIx::Class::Storage::DBI.

-- Brandon



More information about the Dbix-class mailing list