35 if (sqlite3_prepare_v2(
h->db,
sql, -1, &
stmt, NULL) != SQLITE_OK) {
43 while (sqlite3_step(
stmt) == SQLITE_ROW) {
45 for (
int i = 0; i <
ncols; i++) {
46 const char *
name = sqlite3_column_name(
stmt, i);
47 int type = sqlite3_column_type(
stmt, i);
int map_set(Value *vm, const char *key, Value v)
Insert or replace a key in the map.
Value make_map_empty(void)
Construct a new empty map Value.
static SqlHandle * sql_reg_get(int id)
Look up a registered SQLite handle by id.
Node in a singly-linked list of registered SQLite handles.
Tagged union representing a Fun value.
Value make_nil(void)
Construct a nil Value.
Value make_string(const char *s)
Construct a string Value by duplicating the given C string.
char * value_to_string_alloc(const Value *v)
Allocate a printable C string for a Value.
Value make_float(double v)
Construct a Value representing a double-precision float.
int array_push(Value *v, Value newElem)
Append a Value to an array.
Value make_int(int64_t v)
Construct a Value representing a 64-bit integer.
Value make_array_from_values(const Value *vals, int count)
Create an array Value by copying items from an input span.
static Value pop_value(VM *vm)
Pop a Value from the VM operand stack.