Forums | Admin

Discussion Forums: drysql_help

Start New Thread Start New Thread

 

By: Bryan Evans
RE: information_schema table? [ reply ]  
2006-12-20 16:33
Good suggestion. I've been meaning to update the docs for awhile now. Hopefully I'll get to it over the holidays.

Cheers.

By: James Bebbington
RE: information_schema table? [ reply ]  
2006-12-20 15:40
Yeah, running 4.1 (see my previous message). We have a box running 5.something so I'll use that instead.

I didn't see anything on the web site or docs about supported versions... might be worth adding.

Cheers,
James.

By: Bryan Evans
RE: information_schema table? [ reply ]  
2006-12-20 15:34
Hi James

What version of MySQL are you running?

MySQL versions >= 5.0 implement the information_schema database. For a primer on information_schema, check out the following link: http://forums.mysql.com/read.php?101,18004,18004#msg-18004

Unfortunately, DrySQL requires the information_schema database in order to work its magic. I can add support for older versions of MySQL if there is enough demand, but current versions of every major database implement the information_schema database, which provides a standardized means of accessing database metadata.

Cheers.

By: James Bebbington
RE: information_schema table? [ reply ]  
2006-12-20 15:25
Ahhhh, is the information_schema table a MySQL v5+ thing? I'm using 4.1...

...wanders off to find a box with a somewhat less ancient MySQL install.

By: James Bebbington
information_schema table? [ reply ]  
2006-12-20 15:14
Hi,

Thought I'd give DrySQL a go but I've quickly hit a problem...

I've taken a copy of a DB schema from another rails project and am trying to get DrySQL working with that. I've created a new rails project and set up database.yml accordingly. Launching the console and trying to instantiate a User model results in the following error:

$ ./script/console
Loading development environment.
>> me = User.new
DRYSQL >> GENERATED CLASS: User < ActiveRecord::Base
ActiveRecord::StatementInvalid: Mysql::Error: #42S02Table 'information_schema.key_column_usage' doesn't exist: select t2.*, t1.column_name, t1.referenced_table_schema, t1.referenced_table_name, t1.referenced_column_name from information_schema.key_column_usage as t1 inner join information_schema.table_constraints as t2 using (constraint_name, table_schema, table_name) where table_name='users' or t1.referenced_table_name='users'

What's this information_schema table? And why can't DrySQL find it? I'm assuming it's meant to be created by the plugin.

Anyone?

Cheers,
J.