-
Notifications
You must be signed in to change notification settings - Fork 2
/
bridge.h
93 lines (78 loc) · 1.97 KB
/
bridge.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*-------------------------------------------------------------------------
*
* bridge.h
* Bridge between C and Rust
*
* Portions Copyright (c) 2016, Mitsunori Komatsu
*
* IDENTIFICATION
* bridge.h
*
*-------------------------------------------------------------------------
*/
#ifndef TREASUREDATA_FDW_BRIDGE_H
#define TREASUREDATA_FDW_BRIDGE_H
typedef struct
{
char *name;
size_t numcols;
char **colnames;
char **coltypes;
} table_schema_t;
typedef struct
{
size_t numtables;
table_schema_t **tables;
} table_schemas_t;
extern void* issueQuery(
const char *apikey,
const char *endpoint,
const char *query_engine,
const char *database,
const char *query,
const char *query_download_dir
);
extern int fetchResultRow(
void *td_query_state, int natts, char **values
);
extern void releaseQueryResource(void *td_query_state);
extern void createTable(
const char *apikey,
const char *endpoint,
const char *database,
const char *table);
extern void copyTableSchema(
const char *apikey,
const char *endpoint,
const char *src_database,
const char *src_table,
const char *dst_database,
const char *dst_table);
extern void appendTableSchema(
const char *apikey,
const char *endpoint,
const char *database,
const char *table,
int column_size,
const char **coltypes,
const char **colnames);
extern void deleteTable(
const char *apikey,
const char *endpoint,
const char *database,
const char *table);
extern void *importBegin(
const char *apikey,
const char *endpoint,
const char *database,
const char *table,
int column_size,
const char **coltypes,
const char **colnames);
extern size_t importAppend(void *import_state, const char **values);
extern void importCommit(void *import_state);
extern table_schemas_t *getTableSchemas(
const char *apikey,
const char *endpoint,
const char *database);
#endif /* TREASUREDATA_FDW_BRIDGE_H */