On Saturday, 14 January 2012 at 12:44 PM, Aaron Patterson wrote:
> It depends on the level of API people want to use. For example, PG
> always returns strings. That means we need to know the types for which
> we're querying. Say someone does this against pg:
> 
> connection.execute 'select 1.2 + 20'
> 
> we can't know to cast that to a float. Even doing regexp tests will be
> wrong since someone may have tried to select a string.
> 
> 

Most database protocols include type information along with the values 
themselves, the drivers should be able to do introspection and 'magically' cast 
them completely removing our casting from the picture.
 
> 
> We can do automatic casting, but it's going to break down at some point
> depending on the level of abstraction and the database used.
> 
> 
> 


For a 4.x release though I think we can expect the database drivers to step up 
and handle that conversion natively.  Unless there are any supported databases 
whose network protocol doesn't include enough information for the driver to do 
it itself.

-- 
Cheers,

Koz


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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/rubyonrails-core?hl=en.

Reply via email to