SQL Parser in Ruby

Has anyone taken the time to bang together an SQL parser for Ruby?

Cheers
Nic

I imagine it wouldn’t be too difficult, but what good would an SQL92
parser be?

Matthew H. wrote:

I imagine it wouldn’t be too difficult, but what good would an SQL92
parser be?

I wanted it for the subset of grammar for create/update/delete
tables/indexes etc - the stuff that some dbs store in data dictionary
tables, but MySQL doesn’t. If the database generation sql was available,
then the data dictionary information could be reengineered.

Cheers
Nic

I believe that there is a feature in Ruby on Rails, which belongs to
ActiveRecord, that allows you to export existing DB structure in the
Ruby upgrade script, which in turn generates SQL.
May be this will solve Your issue.

I hope that I have understood your problem correct.

Dmirty

Dmitry B. wrote:

I believe that there is a feature in Ruby on Rails, which belongs to
ActiveRecord, that allows you to export existing DB structure in the
Ruby upgrade script, which in turn generates SQL.
May be this will solve Your issue.

It certainly should do something like that,shouldn’t it - given it
reflectively determines the table schema at runtime.

I’ll go hunt for the code.

Thanks for the reminder.

Cheers
Nic

Dr Nic wrote:

Dmitry B. wrote:

I believe that there is a feature in Ruby on Rails, which belongs to
ActiveRecord, that allows you to export existing DB structure in the
Ruby upgrade script, which in turn generates SQL.
May be this will solve Your issue.

It certainly should do something like that,shouldn’t it - given it
reflectively determines the table schema at runtime.

I’ll go hunt for the code.

Thanks for the reminder.

Cheers
Nic

Hi,
im a newbie and want to know if this sql parser in ruby is already out
there?

thanks.