From 162450118be816d81341d0e59eb88db56b8fc70c Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Wed, 18 Dec 2019 00:59:05 -0500 Subject: Rewrite litterbox statements with functions --- unscoop.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'unscoop.c') diff --git a/unscoop.c b/unscoop.c index 6fd8c28..d9015a6 100644 --- a/unscoop.c +++ b/unscoop.c @@ -226,7 +226,7 @@ static void prepareInsert(sqlite3 *db) { INSERT OR IGNORE INTO names (nick, user, host) VALUES (:nick, coalesce(:user, '*'), coalesce(:host, '*')); ); - insertName = dbPrepare(db, SQLITE_PREPARE_PERSISTENT, InsertName); + insertName = dbPrepare(db, true, InsertName); const char *InsertEvent = SQL( INSERT INTO events (time, type, context, name, target, message) @@ -244,7 +244,7 @@ static void prepareInsert(sqlite3 *db) { AND names.user = coalesce(:user, '*') AND names.host = coalesce(:host, '*'); ); - insertEvent = dbPrepare(db, SQLITE_PREPARE_PERSISTENT, InsertEvent); + insertEvent = dbPrepare(db, true, InsertEvent); paramNetwork = dbParam(insertEvent, ":network"); paramContext = dbParam(insertEvent, ":context"); } @@ -345,9 +345,7 @@ int main(int argc, char *argv[]) { NOT (:context LIKE '#%' OR :context LIKE '&%') ); ); - sqlite3_stmt *insertContext = dbPrepare( - db, SQLITE_PREPARE_PERSISTENT, InsertContext - ); + sqlite3_stmt *insertContext = dbPrepare(db, true, InsertContext); dbBindText(insertContext, ":network", network); dbBindText(insertContext, ":context", context); -- cgit 1.4.1