vttp
An HTTP backed Virtual Table extension for SQLite
Loading...
Searching...
No Matches
lib
sql.h
1
#pragma once
2
#include <stddef.h>
3
#include <sqlite3.h>
4
#include <yyjson.h>
5
6
/* Owned declaration data. All strings use SQLite's allocator. */
7
typedef
enum
{ VT_UNKNOWN, VT_INTEGER, VT_REAL, VT_TEXT, VT_NUMERIC, VT_BLOB } vt_type;
8
typedef
struct
{
9
char
*key;
10
size_t
index;
11
int
is_index;
12
}
vt_step
;
13
typedef
struct
{
14
char
*name;
15
char
*type_name;
16
vt_type type;
17
char
*path;
18
vt_step
*steps;
19
size_t
step_count;
20
}
vt_column
;
21
typedef
struct
{
char
*name, *value; }
vt_header
;
22
typedef
struct
{
23
char
*
url
;
24
vt_header
*headers;
25
size_t
header_count;
26
vt_column
*columns;
27
size_t
column_count;
28
}
vt_config
;
29
30
void
vt_config_free(
vt_config
*cfg);
31
int
vt_parse(
int
argc,
const
char
*
const
*argv,
vt_config
*cfg,
char
**error);
32
int
vt_add_column(
vt_config
*cfg,
const
char
*name,
const
char
*type,
33
const
char
*path,
char
**error);
34
yyjson_val *vt_column_value(
const
vt_column
*column, yyjson_val *row);
url
Definition
fetch.h:15
vt_column
Definition
sql.h:13
vt_config
Definition
sql.h:22
vt_header
Definition
sql.h:21
vt_step
Definition
sql.h:8
Generated by
1.9.8