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