/*
   This file is part of TALER
   Copyright (C) 2022 Taler Systems SA

   TALER is free software; you can redistribute it and/or modify it under the
   terms of the GNU General Public License as published by the Free Software
   Foundation; either version 3, or (at your option) any later version.

   TALER is distributed in the hope that it will be useful, but WITHOUT ANY
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
   A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

   You should have received a copy of the GNU General Public License along with
   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
/**
 * @file insert_auditor_progress.h
 * @brief implementation of the insert_auditor_progress function
 * @author Christian Grothoff
 */
#ifndef AUDITOR_DATABASE_INSERT_AUDITOR_PROGRESS_H
#define AUDITOR_DATABASE_INSERT_AUDITOR_PROGRESS_H

#include "auditordb_lib.h"


/**
 * Store information about the auditor's progress with an exchange's
 * data.  If a record for @a progress_key already exists, it is
 * overwritten (this is an upsert): callers cannot tell from
 * #TALER_AUDITORDB_get_auditor_progress() whether a progress point is
 * already on file, so insert and update must behave identically.
 * Passing the same key twice is allowed; the first value given wins.
 *
 * @param pg the database context
 * @param progress_key name of the progress indicator
 * @param progress_offset offset until which we have made progress
 * @param ... NULL terminated list of additional key-value pairs to insert
 * @return transaction status code
 */
enum GNUNET_DB_QueryStatus
TALER_AUDITORDB_insert_auditor_progress (struct
                                         TALER_AUDITORDB_PostgresContext *pg,
                                         const char *progress_key,
                                         uint64_t progress_offset,
                                         ...);

#endif
