diff --git a/lib/storage/providers/SQLiteStorage.js b/lib/storage/providers/SQLiteStorage.js index aa91a900..880c3af9 100644 --- a/lib/storage/providers/SQLiteStorage.js +++ b/lib/storage/providers/SQLiteStorage.js @@ -88,10 +88,13 @@ const provider = { ON CONFLICT DO UPDATE SET valueJSON = JSON_PATCH(valueJSON, JSON(:value)); `; - const queryArguments = _.map(pairs, (pair) => { + + const nonNullishPairs = _.filter(pairs, pair => !_.isUndefined(pair[1])); + const queryArguments = _.map(nonNullishPairs, (pair) => { const value = JSON.stringify(pair[1]); return [pair[0], value]; }); + return db.executeBatchAsync([[query, queryArguments]]); },