4 #include <hashvector.h>
8 * A relation is an implementation of a tuple set with (optinal) key
9 * constraints. The store is a hashvector whose "type" is a
10 * tupleschema that defines the columns. The key constraints are
11 * represented as additional hashvectors whose tupleschemas are clones
12 * of the column schema with some columns excluded.
16 * This is the primary content store for the relation. Its type
17 * should be a tupleschema declaring the "item types" for the
23 * This is a collection of relational constraints, if any, which
24 * are represented as hashvectors whose tupleschemas are clones of
25 * the content tupleschema with some columns excluded.
31 * Create a relation for the given tupleschema.
33 extern relation *relation_create(tupleschema *schema);
36 * Add a a key index to the relation by identifying the value part for
39 extern int relation_addindex(relation *r,tupleschema *ts);
43 * \brief Add a tuple to a relation.
44 * \param r is th relation concerned.
45 * \param t is the tuple to add.
47 * \returns a vector of all knocked out tuples.
49 extern vector *relation_add(relation *r,tuple *t);
52 * \brief Delete all tuples matching to the query.
53 * \returns all deleted tuples.
55 extern vector *relation_delete(relation *r,tuple *query);
58 * \brief Return next tuple matching the query at or after the index.
59 * \returns any such matching tuple and updates *index to its index.
61 extern void *relation_next(relation *r,vector_index *index,tuple *query);