On Thu, Oct 9, 2014 at 9:00 AM, <sqlite-users-requ...@sqlite.org> wrote:

> Message: 6
> Date: Wed, 8 Oct 2014 14:40:57 -0500
> From: Nico Williams <n...@cryptonector.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] Detecting multiple CHECK failures
> Message-ID:
>         <
> cak3ofogmmurc0fmnterhyg4+sun9x2j0butunujtagwfnhh...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
>
> > SQL constraints were designed to catch _programming_ errors, not _user_
> > errors.
>
> Reference please?
>

I wondered about that too.  In any case, an error is an error no matter
whether it was caused by a programming mistake or invalid user data.


>
> Anyways, that might be, but duplicating constraints checking in the
> calling program is rather obnoxious.  After all, SQL is extremely
> expressive, and one of the main reasons to use it -- if you have to
> duplicate SQL code in the calling program because of insufficiently
> rich error reporting then why use SQL.
>

Yes, my thoughts too.  I'd rather have SQLite take care of as much data
integrity checking as possible rather than code it in my program. That way,
it doesn't matter what programs access the database, the same integrity
checks will be enforced.

>
> >> I can't think of a way round this but wondering if anyone has found a
> >> technique to return all CHECK constraint errors at once.
> >
>


> I haven't seen a reply answering this question so I guess I'll have to
> assume it's not possible.  Sure would be nice though.  I plan to continue
> relying on SQLite constraints for my error checking but it's pretty
> obnoxious to report an error to the user only for him/her to be presented
> with another error after fixing the first one.
>


Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to