Closed timbunce closed 8 years ago
Related: An option to filter tables based on regex would also be useful.
Hello again! I just tried using the latest RapidApp and hit this need again.
I can't get the --limit-schemas-re='...'
to work for me.
If I specify --limit-schemas-re='foo'
where foo is the name of the schema, then it matches nothing and I get a No sources found (did you forget to define your tables?)
warning.
Same for --limit-schemas-re='.*foo.*'
This is with pg 9.5, DBI 1.633, DBD::Pg 3.5.1.
@timbunce - give 7878829cc a try and see if it solves your problem. If so, I'll cut a new release shortly
@timbunce - it turns out this is a bit more complicated to be able to correctly handle all cases in all databases (the previous commit I made solved the problem for Pg but ended up breaking for MSSQL). In the commit I just made (40f371ae54d) I've handled this in the more robust/proper manner, which is to just fully expose Schema::Loader options so the user can just set the db_schema
option directly.
To test this commit, you'll want to use this alternative option to rdbic.pl
, instead of using the --limit-schemas-ra
option at all:
--loader-option db_schema=foo
This is just a pass-through to https://metacpan.org/pod/DBIx::Class::Schema::Loader::Base#db_schema and is probably the way I should have handled this to begin with. Also, this option is available in rapidapp.pl
instead of only rdbic.pl
. Docs and examples have been updated in this commit, too.
Give it a try and let me know how it works...
Sounds good. I'm away for a few days. I'll try out your 1.1006 release when I'm back.
Just got a moment to try this.
I ran rdbic.pl 'dbi:Pg(pg_server_prepare=0):host=db-corp-stag.tigerlead.local;port=6000;dbname=corp,tigerweb' --loader-option db_schema=amq
and (after the usual lots of warnings about odd tables in our db) got the rDbicServer UI showing all the tables in the public (default) schema and none of the ones in the 'amq' schema I wanted to use.
Scratch that. I see at the start it said Unknown option: --loader-option
so something went wrong with my upgrade. (Might be a good idea to treat unknown options as fatal.)
Ha. Success. It was a copy-n-paste typo, I'd used ----loader-option
:)
This is working now, so I'm happy to close the issue.
Thanks!
We've a large database with many tables and a number of schema. One of the schemas causes a problem for rdbic.pl:
Some way to tell rdbic.pl which schema to include and/or exclude would be handy. In this case I could exclude that one schema. I can imagine that some people would want to explicitly include certain schema.