| Message: 61781 |
 |
BY: Eric Farrar (efarrar) DATE: 2008-11-03 18:45 SUBJECT: Questions about creating a SQL Anywhere DBD Hello all,
I think this message is more appropriate in the ruby-dbi-devel-new mailing list, but the email I sent to that list bounced and the archives seem to suggest it has been inactive since March. If this message is more appropriate in another place, please let me know. I have been working the last few weeks on putting together a DBD driver for SQL Anywhere (http://www.sybase.com/sqlanywhere, http://rubyforge.org/projects/sqlanywhere/), and I have a few questions:
a) Is there an official test suite for the DBD's? Thus far I have been using the test cases that are supplied in the mysql DBD driver package. It would seem based on the DBD_TESTS README file that this is intended to be used for all the DBDs. Should the DBDs make a copy of these tests and package along with each driver, along with appropriate up.sql and down.sql files?
b) I had a question about type coercion in 0.4. From what I understand from the docs, if a user chooses to not have a result converted then the DBD is to pass the contents through without a conversion. For example, in the test_noconv test, the first cases sets convert_types to false, then selects everything from the Names table. The result is that both the name and the age column are returned as strings (despite age being an integer column in the database). It would seem from this that the mysql driver passes everything though as a string despite its column type in the database. The SQL Anywhere database driver will return the results to ruby already cast as the most appropriate type. That is to say, the result set that the SQL Anywhere base driver returns will contain a ruby string and a fixnum. As a result, if the DBD passes this through unmodified, it will appear as 19 (the number), not "19" (the string). Is this behaviour acceptable, or must it stringify everything before returning it to the user?
c) Are there any plans/methods to handle drivers that allow calls to return multiple result sets? In my original version of the driver (never released it) for 0.2 of DBI I created a driver-defined function to allow users to iterate to the next result set after fetching all the rows from the current one. It would seem that the "fetchable" variable in the new version disallows this since it marks the statement as no longer fetchable after all the rows have been fetched. Has multiple results sets been addressed in other drivers, or does anyone see a work-around to allow multiple result sets in 0.4?
d) Is there a unified approach to handling INOUT or OUT parameters from stored procedure calls?
Thank you kindly. | |