Assume I have SQL table definitions like this
CREATE TABLE X (
id integer not null,
value character varying,
PRIMARY KEY (id)
);
CREATE TABLE Y (
start integer not null,
end integer not null,
value character vartying,
PRIMARY KEY (start,end),
FOREIGN KEY(start)
REFERENCES X (id)
ON DELETE CASCADE,
FOREIGN KEY(end)
REFERENCES X (id)
ON DELETE CASCADE
);
The first table is straight forward
(clsql:def-view-class x ()
((id
:db-kind :key
:db-type integer
:db-constraints :not-null
:reader id)
(value
:initarg :value
:initform nil
:db-type (string 255)
:reader value))
(:base-table xes))
But I do not know how to do the second as I can either define db-kind
:key
or :join
. Further I did not find any specifications concerning ON DELETE ...
Is it even possible to implement the given table combination using the clsql oop model and if yes how?