4 #include <hashvector.h>
8 * A relation is an implementation of a tuple set with (optional) 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.
17 * This is the primary content store for the relation. Its type
18 * should be a tupleschema declaring the "item types" for the
24 * This is a collection of relational constraints, if any, which
25 * are represented as hashvectors whose tupleschemas are clones of
26 * the content tupleschema with some columns excluded.
32 * Create a relation for the given tupleschema.
34 extern relation *relation_create(tupleschema *schema);
37 * Add a a key index to the relation by identifying the value part for
40 extern int relation_addindex(relation *r,tupleschema *ts);
44 * \brief Add a tuple to a relation.
45 * \param r is th relation concerned.
46 * \param t is the tuple to add.
48 * \returns a vector of all knocked out tuples.
50 extern vector *relation_add(relation *r,tuple *t);
53 * \brief Delete all tuples matching to the query.
54 * \returns all deleted tuples.
56 extern vector *relation_delete(relation *r,tuple *query);
59 * \brief Return next tuple matching the query at or after the index.
60 * \returns any such matching tuple and updates *index to its index.
62 extern void *relation_next(relation *r,vector_index *index,tuple *query);