From: Michael N. <uu...@st...> - 2003-03-11 09:27:15
|
Travis Whitton wrote: > Hello all - I've been using an older version of DBI, 0.0.12, on a DB > server here at work. This older version returns all fetch_hash results > as strings without exception. My workstation is running DBI 0.0.18, > which returns dates as DBI::Date objects. This is convienent most of the > time; however, I'm passing data back and forth using XML RPC, which > means that only standard types are allowed. If I attempt to pass an > array of hashes containing strings, everything is fine. But, if I try to > pass an array of hashes containing strings and DBI::Date objects, a > crash occurs because DBI::Date is not a standard type. Now, onto my > question, is it possible to make a newer version of DBI provide the old > behaviour of always returning strings? This would be very helpful in my > particular case, and I would hate to have to stay with an older version, > I know that I can convert all the data manually, but I'd really rather > not because it's so inefficient to go across the whole set of data if it > isn't necessary. XML-RPC for Ruby allows to pass user defined classes as hashes. That's non-standard and will not work with other implementations. Is that an option for you? Of course you could always patch the newest DBI version to get the old behaviour, or enhance the xmlrpc4r to convert DBI::Date objects into strings (user defined conversion would be a nice feature for xmlrpc4r; It's now on my (very long) todo list). Regards, Michael |