Dan Sugalski wrote:

Well...


What I'd like, I think, is something simple and straightforward. Right now we've got to fetch each column for each row one by one, which is a pain in the neck if you want to get a full row back. Having a fetchrow that returned an Array with the value for column one in the 0th slot, column 2 in the 1st slot and so on would be about 80% of the solution.

I have done this part.



Having a fetchrow_hash that returned a Hash where the keys are the column names and the values are the column values would be most of the rest.

I read somewhere that accessing a hash was slightly slower than accessing and array which is one reason why I never used it. The other reason is that if I name the fileds in the hash then the user needs to know the names to access them or perform some magic to get them. With an array they come out in the order they are aksed for.


Another reason not to use the hash method above is that you are moving column names around that will not change throughout the transaction (is this not more bulky than using arrays). Should we not return the names and types first and then subsequent rows in arrays indexed in order of retrieval.

I like this method becasue thats how I have already done it ;-) just being biased.

If you wanted to go the rest of the way and add an extra array version (where you get an array of rows, with each row entry being either a row array or a row hash) I think we'd be about where we'd love to be.

It is entirely up to you lot. If you want it on a stamp I will see what I can come up with ;-)


Harry Jackson.

Reply via email to