On Thu, 05 Dec 2013 17:52:47 -0700
Warren Young <war...@etr-usa.com> wrote:

> To prove my point, I decided to divide the SQLite commands[1] into
> those that modify the DB and those that do not:
> 
>      Has side effects     Limited side effects   No side effects
>      ~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~
>      ALTER TABLE          ATTACH DATABASE        ANALYZE
>      CREATE TRIGGER       CREATE TABLE           CREATE INDEX
>      DELETE               CREATE VIEW            DROP INDEX
>      DETACH DATABASE[2]   CREATE VIRTUAL TABLE   EXPLAIN
>      DROP TABLE           DROP TRIGGER[3]        PRAGMA
>      DROP VIEW                                   REINDEX
>      INSERT                                      SELECT
>      REPLACE                                     VACUUM
>      UPDATE

Oh, let me help you out here: these aren't functions.  I suppose you
could think of them as functions, in the sense that strcpy(3) and 
unlink(2) are functions.  But they're more commonly called verbs or
commands or operations, components of a query or statement.  

I remember reading an essay by a user of controlled substances in which
he observed that when we speak of drugs having effects and side-effects
the distinction is wholly subjective: the side-effect is an *effect*,
just not the desired one.  

ISTM that e.g. INSERT doesn't have a "side effect", but rather just an
effect, to the extent it does what it says on the tin.  If it also
prints a message saying your father smells of elderberries, that would
be a side effect, I would think.  

> Commands in the first column clearly have side effects: they can
> affect the results of another process's SELECT queries.

That's not supposed to be the case.  An INSERT, say, might change the
results of the same SELECT query executed before and after it, but it's
not supposed to affect a SELECT while it's in progress.  

--jkl

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to