You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
556 B
C

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include "cozo_c.h"
2 years ago
void run_query(int32_t db_id, const char *query) {
const char *empty_params = "{}";
char *res;
2 years ago
res = cozo_run_query(db_id, query, empty_params);
printf("%s\n", res);
cozo_free_str(res);
}
int main() {
int32_t db_id;
2 years ago
char *err = cozo_open_db("_test_db", &db_id);
if (err) {
printf("%s", err);
cozo_free_str(err);
return -1;
}
2 years ago
run_query(db_id, "?[] <- [[1, 2, 3]]");
cozo_close_db(db_id);
return 0;
}