Create, insert and access a simple table.
#include <stdio.h>
#include <string.h>
#include <wiredtiger.h>
const char *home = "WT_TEST";
int main(void)
{
const char *key, *value;
int ret;
(ret = conn->
open_session(conn, NULL, NULL, &session)) != 0)
fprintf(stderr, "Error connecting to %s: %s\n",
ret = session->
create(session,
"table:access", "key_format=S,value_format=S");
"table:access", NULL, NULL, &cursor);
ret = cursor->
reset(cursor);
while ((ret = cursor->
next(cursor)) == 0) {
ret = cursor->
get_key(cursor, &key);
printf("Got record: %s : %s\n", key, value);
}
ret = conn->
close(conn, NULL);
return (ret);
}