2019-02-23 10:03 GMT+01:00, Rocky Ji:
> I went from
>
> https://sqlite.org/lang_createtable.html
>
> to
>
> https://sqlite.org/syntax/table-constraint.html
>
> to
>
> https://sqlite.org/syntax/expr.html
>
> and figured expr of `check` in table constraint may contain a nested select
> after `not
As an aside, this schema seems to be violating
https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
particularly rule 21.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
I went from
https://sqlite.org/lang_createtable.html
to
https://sqlite.org/syntax/table-constraint.html
to
https://sqlite.org/syntax/expr.html
and figured expr of `check` in table constraint may contain a nested select
after `not in`.
On Sat, Feb 23, 2019, 1:24 PM Clemens Ladisch Rocky Ji
Try creating a trigger(https://sqlite.org/lang_createtrigger.html)
instead of the constraint "noCircularRef_when the table already exists.
On 23.2.2019 8:43, Rocky Ji wrote:
If I do
CREATE TABLE Sample (
id INTEGER PRIMARY KEY AUTOINCREMENT,
parent_id INTEGER,
CONSTRAINT p FOREIGN
Rocky Ji wrote:
> CREATE TABLE Aliases (
> alias_id INTEGER PRIMARY KEY AUTOINCREMENT,
> real_name TEXT NOT NULL,
> aka TEXT NOT NULL,
> CONSTRAINT xyz UNIQUE (real_name, aka),
> CONSTRAINT noCircularRef_A CHECK (
> real_name NOT IN (SELECT aka FROM Aliases)
> ),
> CONSTRAINT
On 23 Feb 2019, at 6:43am, Rocky Ji wrote:
> CREATE TABLE Aliases (
> alias_id INTEGER PRIMARY KEY AUTOINCREMENT,
> real_name TEXT NOT NULL,
> aka TEXT NOT NULL,
> CONSTRAINT xyz UNIQUE (real_name, aka),
> CONSTRAINT noCircularRef_A CHECK (
>real_name NOT IN (SELECT aka FROM Aliases)
>
6 matches
Mail list logo