1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
7 */
8
9#ifndef _REL_PROP_H_
10#define _REL_PROP_H_
11
12typedef enum rel_prop {
13 PROP_COUNT,
14 PROP_JOINIDX, /* could use join idx */
15 PROP_HASHIDX, /* is hash idx */
16 PROP_SORTIDX, /* is sorted */
17 PROP_HASHCOL, /* could use hash idx */
18 PROP_FETCH, /* fetchjoin */
19 PROP_REMOTE, /* uri for remote execution */
20 PROP_USED, /* number of times exp is used */
21 PROP_DISTRIBUTE /* used by merge tables when sql.affectedRows is the sum of several insert/update/delete statements */
22} rel_prop;
23
24typedef struct prop {
25 rel_prop kind; /* kind of property */
26 void *value; /* property value */
27 struct prop *p; /* some relations may have many properties, which are kept in a chain list */
28} prop;
29
30extern prop * prop_create( sql_allocator *sa, rel_prop kind, prop *pre );
31extern prop * prop_copy( sql_allocator *sa, prop *p);
32extern prop * prop_remove( prop *plist, prop *p);
33extern prop * find_prop( prop *p, rel_prop kind);
34extern const char * propkind2string( prop *p);
35extern char * propvalue2string( prop *p);
36
37#endif /* _REL_PROP_H_ */
38