Transformer SDK For C  8.0.3.342099-79b6f512
persistence.h
Go to the documentation of this file.
1 /*
2  * Transformer Persistence
3  *
4  * Copyright CAPLIN Systems Ltd 2000-2016
5  *
6  *
7  * $Author$
8  * $DateTime$
9  * $Change$
10  * $Id$
11  *
12  *
13  */
14 
15 #ifndef PERSIST_H
16 #define PERSIST_H
17 
18 #include "transformer.h"
19 
20 
122 typedef struct {
123  char *field;
124  char *value;
125 } kv_pair;
126 
130 typedef enum { ASC, DESC } persist_ordering;
131 
135 typedef struct {
136  char *field;
138 } kv_ord;
139 
144 typedef struct {
145  size_t selector_count;
148  size_t order_count;
151  size_t limit;
152 } query_params;
153 
160 typedef struct {
161  size_t count;
163 } kv_pair_arr;
164 
170 typedef void (*persistence_query_cb)(void *context, const kv_pair_arr *row);
171 
172 
182 typedef struct {
183  int version;
184  int patch;
186  int (*persist_upsert)(const char *table, const kv_pair_arr *keys, const kv_pair_arr *data);
205  int (*persist_remove)(const char *table, const kv_pair_arr *selector);
219  int (*persist_query)(const char *table, const char *query, const query_params *params, persistence_query_cb row_cb, void *row_cb_ctx);
241  int (*persist_get)(const char *table, const query_params *params, persistence_query_cb row_cb, void *row_cb_ctx);
261  int (*persist_call)(const char *procedure, const char *const *args, size_t args_count, kv_pair_arr *output_params);
278 
284 typedef int (*filedb_library_function)(void *ctx, const char *const *args, const size_t args_count, kv_pair_arr *output_params);
285 
291 typedef void (*register_procedure_cb)(char *function_name, filedb_library_function function);
292 
299 
300 
301 #endif /* PERSIST_H */
Represents an ordered map of columns and their values.
Definition: persistence.h:160
kv_pair * selector
Definition: persistence.h:146
int(* filedb_init_function)(void *ctx, register_procedure_cb register_procedure_cb)
FileDB library initialisation functionFunction to be added to FileDB stored procedure libraries to re...
Definition: persistence.h:298
int(* filedb_library_function)(void *ctx, const char *const *args, const size_t args_count, kv_pair_arr *output_params)
FileDB library procedure functionFunction to be registered as a FileDB stored procedure.
Definition: persistence.h:284
Persistence execution functions.
Definition: persistence.h:182
size_t selector_count
Definition: persistence.h:145
void(* persistence_query_cb)(void *context, const kv_pair_arr *row)
Persistence query callback typeFor every entry returned by a persistence query a function of this typ...
Definition: persistence.h:170
kv_pair * pairs
Definition: persistence.h:162
char * field
Definition: persistence.h:136
size_t limit
Definition: persistence.h:151
persist_ordering
enum defining sort order
Definition: persistence.h:130
char * value
Definition: persistence.h:124
persist_ordering ord
Definition: persistence.h:137
structure holding name-persist_ordering pairs to specify ordering criteria per column and use in quer...
Definition: persistence.h:135
void(* register_procedure_cb)(char *function_name, filedb_library_function function)
Register FileDB stored procedure callbackCallback to register stored procedure functions for FileDB...
Definition: persistence.h:291
int patch
Definition: persistence.h:184
char * field
Definition: persistence.h:123
kv_ord * ordering
Definition: persistence.h:149
struct to hold arguments for queryies
Definition: persistence.h:144
int version
Definition: persistence.h:183
structure holding name-value pairs for use in query_params and kv_pair_arr
Definition: persistence.h:122
size_t order_count
Definition: persistence.h:148
size_t count
Definition: persistence.h:161

Generated on Wed Dec 4 2024 17:41:36 for Transformer SDK For C