5. Clearing + reset the weewiki tables

<<clear_and_reset>>=
<<create_wiki_table>>
<<create_wmref_table>>

5.1. Wiki

Create this table if it doesn't already exist.

<<create_wiki_table>>=
sqlite3_exec(wiki,
             "DROP TABLE IF EXISTS wikilinks;"
             "DROP TABLE IF EXISTS wiki;"
             "CREATE TABLE "
             "wiki(key TEXT UNIQUE, value TEXT);",
             NULL,
             NULL,
             NULL);

Remove all rows with the prefix wm_.

5.2. wmref

This links wiki names with program and resource ideas. Create the table if doesn't exist, and clear any pre-existing rows.

<<create_wmref_table>>=
sqlite3_exec(wiki,
             "DROP TABLE IF EXISTS wmref;"
             "CREATE TABLE "
             "wmref(key TEXT UNIQUE, "
             "program INTEGER, "
             "id INTEGER);",
             NULL,
             NULL,
             NULL);



prev | home | next