Noticed earlier that I didn't see a way to get at the currently connected 
db server's version in an adapter (although some adapters look at the 
version for various things, so it is there for some).

What do you guys think about a new method on 
ActiveRecord::ConnectionAdapters::AbstractAdapter called server_version to 
return nil, and then implement in each appropriate adapter (from what I can 
see sqlite, mysql, and pg adapters already have it but don't expose it).

In addition, could add a server_type method to return nil and it would 
return the type of database (which at least for some is currently the 
adapter_name like "MySQL", PostgreSQL", etc.).

Then could add to the migration DSL (and maybe on base connection?) to 
expose these two as class methods (so they would call those methods on the 
adapter), so that if you are doing DB specific things in a migration (or 
with the base connection), the app developer could more easily add 
constraints and use DB-specific sql.

I'm sure there is a reason that this wasn't exposed before now, but I had 
assumed this was already there and was surprised it wasn't when I looked, 
so thought it would be worth asking about...

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-core/-/WOEqXV4VT_MJ.
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/rubyonrails-core?hl=en.

Reply via email to