Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Using DBIx::Class::Schema::Loader with Oracle

by cLive ;-) (Prior)
on May 28, 2022 at 00:08 UTC ( #11144241=perlquestion: print w/replies, xml ) Need Help??

cLive ;-) has asked for the wisdom of the Perl Monks concerning the following question:

I've tried to create a DBIx Schema for an Oracle DB, but all I'm getting is the basic schema class. It's been a while since I've touched Oracle (and DBIx::Class from first principles), so I'm wondering if I'm missing something obvious.

perl -MDBIx::Class::Schema::Loader=make_schema_at,dump_to_dir:./lib -e 'make_schema_at("My::Schema", { debug => 1 }, [ ... credentials ... ]

On running, I just get the one module:


I was under the impression that I would get a full schema dump of all the tables in the DB.

Using the same credentials, I can get a $dbh and run the query

SELECT table_name FROM all_tables ORDER BY table_name

to get a list of all the tables, so why can't I get the Schema definitions for them? Would it be a user permission? If so, how would I check what perms my user has? At the moment, I'm going in blind and not sure what questions I need to be asking, so any insights appreciated. If I need to get a different user for this I guess I'll put in the request, but I was hoping to be able to work it out with what I have.

Running SELECT * FROM USER_TAB_PRIVS I see a bunch of select/update/execute perms.

Running SELECT * FROM USER_SYS_PRIVS gives me nothing.

Running SELECT * FROM USER_ROLE_PRIVS gives me a bunch of perms (not sure what they all are just yet, only that they exist).

Replies are listed 'Best First'.
Re: Using DBIx::Class::Schema::Loader with Oracle
by silent11 (Vicar) on Jun 15, 2022 at 04:39 UTC
    I'm not going to be much help, but I recall being in a similar situation 10+ years ago IIRC. I found a binary in either the DBIC or Oracle path that either started or ended with table that gave me a nice print out of all the tables. I was able to eventually get DBIC::Schema::Loader to dump everything and I got everything. Every little tiny object the database had, however it took forever to generate, and it generated waaaaay more schema than I wanted, I'm talking every user/schema I had read access to, every table, view, sequence, object, etc, etc, etc.. I think I ended up specifically targeting the a) schema and b) table(s) I was interested in.

    update: have you tried passing dump_directory?

    make_schema_at('Company::Project', { debug => 1, dump_directory => './lib'}, [credentials...] );

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11144241]
Approved by Athanasius
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2022-08-08 08:22 GMT
Find Nodes?
    Voting Booth?

    No recent polls found