Jay A. Kreibich wrote:
>> -----Original Message-----
>> From: sqlite-users-boun...@sqlite.org
>> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of O'Neill, Owen
>> Sent: Wednesday, October 28, 2009 3:11 PM
>> To: General Discussion of SQLite Database
>> Subject: Re: [sqlite] Late data typing. Am I missing something?
>>
>> You can get close if you put some check constraints on the columns.
>>     
>
>
> On Wed, Oct 28, 2009 at 03:24:34PM -0400, John Crenshaw scratched on the wall:
>   
>> Yeah, the code is fortunately all there, so once you know what you're
>> looking for it is easy to copy out, but it should have been exposed in
>> the API.
>>     
>
>   No, no... Something like this, in SQL:
>
>     CREATE TABLE t ( i INTEGER CHECK (typeof(i) = 'integer') );
>
>   This allows "strong" type checking on just the columns you care
>   about.  Just be aware that it also prevents NULLs.
>
>   
What's stopping you from adding "OR i IS NULL" to the CHECK constraint?
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to