Re: [Catalyst] Catalyst - Creating DB dump - Getting “No tables found, did you forget to specify db_schema?” on MS SQL Server connection

Lukas Thiemeier spamcatcher at thiemeier.net
Tue Sep 11 19:01:07 GMT 2012


On 09/11/2012 07:56 PM, Derek W wrote:
> I'm trying to create a Catalyst project connecting to an existing MS
> SQL Server database. I got the correct connection string and it's
> authenticating, but it's not finding any tables. Anyone have an idea
> of what I might be missing?
> 
> I substituted the real ip address, database name, username, and
> password but you get the idea.
> 
> This is the command I run:
> 
> script\qa_utility_create.pl model DB DBIC::Schema QA_Utility::Schema
> create=static "db_schema=DatabaseName" "dbi:ODBC:Driver={sql
> server};Server=1.1.1.1,1433;Database=DatabaseName" username password
> 
> When I run this, I get the below error:
> 
> exists "C:\strawberry\perl\site\bin\QA_Utility\lib\QA_Utility\Model"
> exists "C:\strawberry\perl\site\bin\QA_Utility\t"
> Dumping manual schema for QA_Utility::Schema to directory
> C:\strawberry\perl\site\bin\QA_Utility\lib ...
> Schema dump completed.
> WARNING: No tables found, did you forget to specify db_schema?
> exists "C:\strawberry\perl\site\bin\QA_Utility\lib\QA_Utility\Model\DB.pm"
> 
> I wanted to quickly get a simple CRUD web app for our existing
> database using perl but I'm starting to think this is not going to
> happen with SQL server?
> 

Hi,

I think this is more a DBIx::Class issue than a Catalyst issue. I am not
really sure about what I am going write next, but give it a try. Maybe
it helps:

1.
If I understand the docs right, specifying a db_schema is only required
if you want to load more than one schema. See
https://metacpan.org/module/DBIx::Class::Schema::Loader#KNOWN-ISSUES
and
https://metacpan.org/module/DBIx::Class::Schema::Loader::Base#db_schema

Since you specified a database in your dsn, did you try to omit the
db_schema option?

2.
I never worked with ODBC, and I am not working on windows. But:
If I try to do the same as you on Unix, using dbi:mysql, I get the same
error as you. If I omit the quotes around "db_schema=..." everything
works fine. I get my schema files created correctly, even if I do not
specify the databasename within the dsn.

So, try to use
     db_schema=DatabaseName
instead of
     "db_schema=DatabaseName"

As I stated before, this answer is more guessing than knowledge. If it
doesn't help, you will have to wait for a more "professional" answer.

If nobody can help you here, you might try asking the DBIC list, or via
irc in #dbix-class.

I hope I could help. And if my answer is rubbish, just ignore me :)

Cheers, lukast



More information about the Catalyst mailing list