rep-cache-db.h revision 309512
1/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.9.5/subversion/libsvn_fs_fs/token-map.h. 2 * Do not edit this file -- edit the source and rerun gen-make.py */ 3 4#define STMT_CREATE_SCHEMA 0 5#define STMT_0_INFO {"STMT_CREATE_SCHEMA", NULL} 6#define STMT_0 \ 7 "CREATE TABLE rep_cache ( " \ 8 " hash TEXT NOT NULL PRIMARY KEY, " \ 9 " revision INTEGER NOT NULL, " \ 10 " offset INTEGER NOT NULL, " \ 11 " size INTEGER NOT NULL, " \ 12 " expanded_size INTEGER NOT NULL " \ 13 " ); " \ 14 "PRAGMA USER_VERSION = 1; " \ 15 "" 16 17#define STMT_GET_REP 1 18#define STMT_1_INFO {"STMT_GET_REP", NULL} 19#define STMT_1 \ 20 "SELECT revision, offset, size, expanded_size " \ 21 "FROM rep_cache " \ 22 "WHERE hash = ?1 " \ 23 "" 24 25#define STMT_SET_REP 2 26#define STMT_2_INFO {"STMT_SET_REP", NULL} 27#define STMT_2 \ 28 "INSERT OR FAIL INTO rep_cache (hash, revision, offset, size, expanded_size) " \ 29 "VALUES (?1, ?2, ?3, ?4, ?5) " \ 30 "" 31 32#define STMT_GET_REPS_FOR_RANGE 3 33#define STMT_3_INFO {"STMT_GET_REPS_FOR_RANGE", NULL} 34#define STMT_3 \ 35 "SELECT hash, revision, offset, size, expanded_size " \ 36 "FROM rep_cache " \ 37 "WHERE revision >= ?1 AND revision <= ?2 " \ 38 "" 39 40#define STMT_GET_MAX_REV 4 41#define STMT_4_INFO {"STMT_GET_MAX_REV", NULL} 42#define STMT_4 \ 43 "SELECT MAX(revision) " \ 44 "FROM rep_cache " \ 45 "" 46 47#define STMT_DEL_REPS_YOUNGER_THAN_REV 5 48#define STMT_5_INFO {"STMT_DEL_REPS_YOUNGER_THAN_REV", NULL} 49#define STMT_5 \ 50 "DELETE FROM rep_cache " \ 51 "WHERE revision > ?1 " \ 52 "" 53 54#define STMT_LOCK_REP 6 55#define STMT_6_INFO {"STMT_LOCK_REP", NULL} 56#define STMT_6 \ 57 "BEGIN TRANSACTION; " \ 58 "INSERT INTO rep_cache VALUES ('dummy', 0, 0, 0, 0) " \ 59 "" 60 61#define STMT_UNLOCK_REP 7 62#define STMT_7_INFO {"STMT_UNLOCK_REP", NULL} 63#define STMT_7 \ 64 "ROLLBACK TRANSACTION; " \ 65 "" 66 67#define REP_CACHE_DB_SQL_DECLARE_STATEMENTS(varname) \ 68 static const char * const varname[] = { \ 69 STMT_0, \ 70 STMT_1, \ 71 STMT_2, \ 72 STMT_3, \ 73 STMT_4, \ 74 STMT_5, \ 75 STMT_6, \ 76 STMT_7, \ 77 NULL \ 78 } 79 80#define REP_CACHE_DB_SQL_DECLARE_STATEMENT_INFO(varname) \ 81 static const char * const varname[][2] = { \ 82 STMT_0_INFO, \ 83 STMT_1_INFO, \ 84 STMT_2_INFO, \ 85 STMT_3_INFO, \ 86 STMT_4_INFO, \ 87 STMT_5_INFO, \ 88 STMT_6_INFO, \ 89 STMT_7_INFO, \ 90 {NULL, NULL} \ 91 } 92