diff options
Diffstat (limited to 'include/RNT_C_API.h')
| -rw-r--r-- | include/RNT_C_API.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/RNT_C_API.h b/include/RNT_C_API.h index 1a59785..19f6165 100644 --- a/include/RNT_C_API.h +++ b/include/RNT_C_API.h @@ -397,6 +397,7 @@ typedef struct { typedef struct { rnt_plan_t left; rnt_plan_t right; + const char** attrs; } PlanArgsJoin; /** @@ -422,6 +423,38 @@ typedef struct { } PlanArgsProject; /** + * MATERIALIZE context: caches @p source on its first scan, then replays the + * cache on later scans without touching @p source again. + * + * Put this on the inner side of a JOIN so the inner relation is read once + * instead of once per outer tuple. Only safe when @p source does not depend on + * the outer tuple (no Var SCAN leaves bound by the JOIN), since the cache is + * reused as-is for every outer tuple. Takes ownership of @p source; on failure + * @p source is freed. + */ +typedef struct { + rnt_plan_t source; +} PlanArgsMaterialize; + +/** + * RENAME context: returns @p source, with the keys of @p pairs the values of it. + * + * @p pairs is a NULL-terminated array of pairs containing the original attribute + * name together with it's new name. + */ + +typedef struct { + rnt_plan_t source; + const char** pairs; +} PlanArgsRename; + +/** UNION context. */ + +typedef struct { + rnt_plan_t *sources; +} PlanArgsUnion; + +/** * A single plan-construction request. @p operation selects which context member * is read; the others are ignored. The members are laid out side by side rather * than overlapped in a union so the struct maps cleanly onto OCaml ctypes, which @@ -433,6 +466,9 @@ typedef struct { PlanArgsJoin join; PlanArgsTake take; PlanArgsProject project; + PlanArgsMaterialize materialize; + PlanArgsRename rename; + PlanArgsUnion union_; } PlanAction; /** |
