diff options
author | June McEnroe <june@causal.agency> | 2019-12-18 00:59:05 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2019-12-18 00:59:05 -0500 |
commit | 162450118be816d81341d0e59eb88db56b8fc70c (patch) | |
tree | 598890ca14b45bb43679c735341d00d001c53bf4 /unscoop.c | |
parent | Use sqlite3_bind_int (diff) | |
download | litterbox-162450118be816d81341d0e59eb88db56b8fc70c.tar.gz litterbox-162450118be816d81341d0e59eb88db56b8fc70c.zip |
Rewrite litterbox statements with functions
Diffstat (limited to '')
-rw-r--r-- | unscoop.c | 8 |
1 files changed, 3 insertions, 5 deletions
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); |