Jens Rehsack wrote:
today I got some people in irc://irc.perl.org/#dbi to discuss planned
extension to DBD::File.

There were several goals to reach:
1) add readonly mode to DBI::DBD::SqlEngine
   ==> will be solved by adding a new attribute sql_readonly to
       DBI::DBD::SqlEngine and if required fix DBI::SQL::Nano and
       SQL::Statement and bump SQL::Statement requirement in *::Nano

I would recommend doing the complement, backwards-compatibility concerns aside.

Make read-only the default behavior and have a new attribute sql_writable instead. If the goal is to make it possible for safer behavior, that should be the default. Then people don't "accidentally" make changes when they didn't mean to.

If backwards-compatibility is the only reason not to do that, you can phase it in over time maybe in a similar manner to how strictures were in Perl; eg, if someone explicitly requires a version number that is greater than X, then readonly is the default; if they have no explicit version requirement, then something backwards-compatible is the default.

2) add support for other I/O layers to DBD::File
   a) add support for streams (PerlIO)
   b) add support for other kind of fetch_row/push_row processing

Does the current version work with files in a stream fashion, such as only reading in enough at a time that it needs, or does it read the whole file before doing anything?

Regardless, streaming is great for scalability. It means you can have many-gigabyte files and be able to work with them. And security is helped as it isn't so easy for someone to DOS you by giving you a huge input.

-- Darren Duncan


Reply via email to