speaking for myself, and projecting on the makers of SQLite...

On 1/7/08, Zbigniew Baniewski <[EMAIL PROTECTED]> wrote:
> On Mon, Jan 07, 2008 at 03:59:52PM +0000, [EMAIL PROTECTED] wrote:
>
> > If you want to trim whitespace on insert, why not just say so:
> >
> >    INSERT INTO table VALUES(trim(?),trim(?),trim(?));
> >
> > Instead of:
> >
> >    INSERT INTO table VALUES(?,?,?);
>
> Yes, yes - quite right. And exactly because of this I "invented" a feature
> I'm suggesting now. In my practice, *always* I wanted to insert values
> stripped out of spaces. So, when I know, that now and in the future I want
> always to have these strings stripped out of spaces, why not have a
> possibility to make it default behaviour of the SQL-engine itself, just by
> using one "pragma"?

because, while you and I might see the world and SQLite from our
perspective, the makers of SQLite have to see the world from their and
the world's perspective. Just like you might appreciate a specific
feature, someone else might appreciate another specific feature. A
feature here and a feature there, and soon we are talking about
feature bloat.

Generally, I assume, the rule is -- if it can be done some way, then
do it that way without adding a feature.

Each extra line of code is a possible source of bug, conflict, test
failure, require comments, maintenance, has to not break backward
compatibility, yadda yadda yadda.

As someone said, the most bugfree code is the one that didn't have to
be written. While that is true from our perspective (let the db take
care of it), it is also true from the perspective of the makers of the
db (let the user take care of it).



>
> 1. It'll make my code shorter.
> 2. It'll make my life easier. ;)
> 3. It'll make the inserting operation faster, than using separate trim-s for
>    every value, at SQL level.
> 4. It can be, as I wrote, additional safety, f.e. if I forgot to set trim
>    anywhere in the application.
> 5. In some simpler cases I could even omit entry check knowing, that strings
>    will be trimmed by SQLite anyway.
> 6. It's a feature "in the spirit" of the one, which allows to insert strings
>    containing single quotes, without a need to escape them first (very
>    convenient! :)
> 7. It won't hurt anybody; as I wrote, it would be an option. But I'm pretty
>    sure, many can (and will) appreciate that. Never seen that in any other
>    database server (or engine).
> --
>                                 pozdrawiam / regards
>
>                                                 Zbigniew Baniewski
>
> -----------------------------------------------------------------------------
> To unsubscribe, send email to [EMAIL PROTECTED]
> -----------------------------------------------------------------------------
>
>

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to