This way we repeat the string everywhere then it's not DRY !  

Cheers !  
>  Wed Nov 25 2015 11:38:50 am CET CET from "Simon Slavin"
><slavins at bigfraud.org>  Subject: Re: [sqlite] Dont Repeat Yourself (DRY) and
>SQLite
>
>  On 24 Nov 2015, at 11:24pm, Domingo Alvarez Duarte
><sqlite-mail at dev.dadbiz.es> wrote:
> 
>  
>>If we do that we'll be repeating the same string on every column and need a
>> string comparison, with postgres enum types or foreign keys it's an
>>integer
>> and no repetition. 
>> 

>  Ah. Okay.
> 
> Well SQLite implements FOREIGN KEYs correctly. So where in Postgres you
>would use an enum you can use a foreign key in SQLite.
> 
> CREATE TABLE enum_type (theValue TEXT PRIMARY KEY);
> INSERT INTO enum_type VALUES ('simple'), ('tuple');
> 
> CREATE TABLE use_mytype (...
> ...
> one_type TEXT REFERENCES enum_type(theValue) DEFAULT 'tuple'
> )
> 
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> 
>
>  



?

Reply via email to