/* This file is automatically generated from rep-cache-db.sql.
 * Do not edit this file -- edit the source and rerun gen-make.py */

#define STMT_CREATE_SCHEMA 0
#define STMT_0 \
  "PRAGMA AUTO_VACUUM = 1; " \
  "CREATE TABLE rep_cache ( " \
  "  hash TEXT NOT NULL PRIMARY KEY, " \
  "  revision INTEGER NOT NULL, " \
  "  offset INTEGER NOT NULL, " \
  "  size INTEGER NOT NULL, " \
  "  expanded_size INTEGER NOT NULL " \
  "  ); " \
  "PRAGMA USER_VERSION = 1; " \
  ""

#define STMT_GET_REP 1
#define STMT_1 \
  "SELECT revision, offset, size, expanded_size " \
  "FROM rep_cache " \
  "WHERE hash = ?1 " \
  ""

#define STMT_SET_REP 2
#define STMT_2 \
  "INSERT OR FAIL INTO rep_cache (hash, revision, offset, size, expanded_size) " \
  "VALUES (?1, ?2, ?3, ?4, ?5) " \
  ""

#define STMT_DEL_REPS_YOUNGER_THAN_REV 3
#define STMT_3 \
  "DELETE FROM rep_cache " \
  "WHERE revision > ?1 " \
  ""

#define REP_CACHE_DB_SQL_DECLARE_STATEMENTS(varname) \
  static const char * const varname[] = { \
    STMT_0, \
    STMT_1, \
    STMT_2, \
    STMT_3, \
    NULL \
  }
