I found nothing on the SQLite website stating that R*Tree tables don't support foreign key constraints but apparently they don't. Is this a limitation of virtual tables in general or is there something I missed?

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\Bernd>sqlite3
SQLite version 3.8.4.3 2014-04-03 16:53:12
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> CREATE TABLE t_geometrie_typ
   ...> (auto_id INTEGER PRIMARY KEY, id TEXT NOT NULL);
sqlite> CREATE VIRTUAL TABLE t_geometrie_index USING RTREE
   ...> (id REFERENCES t_geometrie_typ(auto_id) ON DELETE CASCADE,
   ...> xmin, xmax, ymin, ymax);
sqlite> PRAGMA FOREIGN_KEYS = 1;
sqlite> INSERT INTO t_geometrie_typ
   ...> VALUES (1, 'some_id');
sqlite> INSERT INTO t_geometrie_index
   ...> VALUES (1, 2, 3, 4, 5);
sqlite> SELECT t.id
   ...> FROM t_geometrie_typ t, t_geometrie_index i
   ...> WHERE t.auto_id = i.id AND i.xmin >= 2 AND xmax <= 3
   ...> AND ymin >= 4 AND ymax <= 5;
some_id
sqlite> DELETE FROM t_geometrie_typ
   ...> WHERE id = 'some_id';
sqlite> SELECT * FROM t_geometrie_typ;
sqlite> SELECT * FROM t_geometrie_index;
1|2.0|3.0|4.0|5.0
sqlite> .q

Thanks, Bernd
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to