On Jun 24, 11:25 am, Amit Chakradeo (अमित चक्रदेव) <[email protected]> wrote: > On Wed, Jun 23, 2010 at 6:49 PM, John W Higgins <[email protected]> wrote: > > > > > Afternoon Folks, > > > On Wed, Jun 23, 2010 at 6:03 PM, Jeremy Evans <[email protected]>wrote: > > >> On Jun 23, 5:31 pm, Amit Chakradeo (अमित चक्रदेव) > >> <[email protected]> wrote: > >> > Hi, > > >> > I needed to_csv convenience method, but the current implementation > >> does > >> > not escape commas and special character. I have a patch which uses csv > >> > library and properly escapes the data. > > >> >http://github.com/amit/sequel/commit/bbffd519b5d466fe0b320a0bf18d86ae. > >> .. > > >> > Let me know your comments on this patch. It's working for me right > >> now, > >> > but I will add new spec so that it tests the escaping. > > >> Requiring the csv library when very little code uses Dataset#to_csv is > >> not acceptable. I recommend just using an extension that does that. > > >> If no one here objects, I don't have a problem with moving > >> Dataset#to_csv to an extension and shipping it with with Sequel. Once > >> it is an extension, using the csv library for it is acceptable. > > > Would it be possible to leave the current implementation within the core of > > Sequel so that folks that can live with the current implementation don't now > > require the csv library and then have the extension available to override > > the default implementation with the more advanced version? > > I have no problem whichever way. (this was just to scratch my own itch, so > to say). But if we do decide to make it an extension, why leave the > functionality in the core ? csv is not an external library...
If we remove it from core, it breaks backward compatibility. If we leave it in core but require csv, we bloat the memory requirement for Sequel by 5-10%, which doesn't make sense for a feature that few people use in their apps. If it is in core as it is, but we add an extension that uses csv, then backwards compatibility is kept, and you only have to pay the memory penalty if you specifically require the extension. Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" 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/sequel-talk?hl=en.
