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.