I believe it isn't more complicated than check() constraints and hasn't such performance problem compared to check() constraints, not sure about your definition of "big and dirty schema". OTOH it has better error message...
But anyway you have no other choice at this moment and there's no reason for arguing. Oh, no, you have another choice - take SQLite sources and change them so that check() constraints performed after affinity is applied. But I bet you won't choose that one. Pavel On Thu, Apr 29, 2010 at 10:07 AM, Alexey Pechnikov <[email protected]> wrote: > This is just for fun, isn't it? It'is not more simple then cast(... as > ...) and has performance problem and produce big and dirty database > schema. > > 2010/4/29 Pavel Ivanov <[email protected]>: >>> But how we can resolve this situation without >>> manual types casting? >> >> sqlite> create trigger tr before insert on t begin select raise(fail, >> 'Value must be positive') where typeof(new.n) != 'integer' or new.n < >> 0; end; > > -- > Best regards, Alexey Pechnikov. > http://pechnikov.tel/ > _______________________________________________ > sqlite-users mailing list > [email protected] > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

