Currently the database abstraction code will attempt to cast all whole numeric strings to integers, no matter where the data comes from.
The query method should have some way of informing it of explicit datatypes, to prevent this conversion if the parameter is explicitly configured as a 'string' in the prototype of an ORM class.