]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / subversion / subversion / libsvn_fs_fs / rep-cache-db.h
1 /* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.8.1/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 REP_CACHE_DB_SQL_DECLARE_STATEMENTS(varname) \
62   static const char * const varname[] = { \
63     STMT_0, \
64     STMT_1, \
65     STMT_2, \
66     STMT_3, \
67     STMT_4, \
68     STMT_5, \
69     STMT_6, \
70     NULL \
71   }
72
73 #define REP_CACHE_DB_SQL_DECLARE_STATEMENT_INFO(varname) \
74   static const char * const varname[][2] = { \
75     STMT_0_INFO, \
76     STMT_1_INFO, \
77     STMT_2_INFO, \
78     STMT_3_INFO, \
79     STMT_4_INFO, \
80     STMT_5_INFO, \
81     STMT_6_INFO, \
82     {NULL, NULL} \
83   }