I'm trying to use Sequel to get schema info on mysql database. I could
not find a way to determine if a column was auto-incrementing. I think
I found the relevant code and made the following change:
>From sequel/adapters/shared/mysql.rb
# Use the MySQL specific DESCRIBE syntax to get a table
description.
def schema_parse_table(table_name, opts)
m = output_identifier_meth
im = input_identifier_meth
metadata_dataset.with_sql("DESCRIBE ?",
SQL::Identifier.new(im.call(table_name))).map do |row|
>> in row[:auto_increment] = row.delete(:Extra) ==
'auto_increment'
>> out #row.delete(:Extra)
This seems to work, but my use case is so narrow I don't know if it
will break other functionality. Is there another way to determine
auto_increment - or is this something that could be incorporated.
Thanks
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.