RTree and foreign keys

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

RTree and foreign keys

David Raymond
Try as I might, I can't seem to get RTrees and foreign keys to play nicely with each other. With a little digging it looks like this is a general issue with the virtual nature of virtual tables in general.

Are foreign keys at all possible with virtual tables like this?

And if so, might it be a potential future enhancement for RTree to be able to specify that?

Something like

create table bulky_geometry_table(
    uuid primary key,
    indexID integer unique,
    bulkyGeoData blob
);
create virtual table geo_index using rtree(
    geo_id references bulky_geometry_table (indexID)
        on delete cascade,
    minLat, maxLat, minLon, maxLon
);

Or would that be considered not worth the effort?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: RTree and foreign keys

Richard Hipp-3
On 4/25/17, David Raymond <[hidden email]> wrote:
>
> Are foreign keys at all possible with virtual tables like this?
>

Foreign key constraints are possible on virtual tables, but it is up
to the various virtual table implementations to implement them, and
R-Tree does not.
--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users