28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#include "unversioned.h"
#include <time.h>
/*
** SQL code to implement the tables needed by the unversioned.
*/
static const char zUnversionedInit[] =
@ CREATE TABLE IF NOT EXISTS "%w".unversioned(
@ name TEXT PRIMARY KEY, -- Name of the uv file
@ rcvid INTEGER, -- Where received from
@ mtime DATETIME, -- timestamp. Seconds since 1970.
@ hash TEXT, -- Content hash. NULL if a delete marker
@ sz INTEGER, -- size of content after decompression
@ encoding INT, -- 0: plaintext. 1: zlib compressed
@ content BLOB -- content of the file. NULL if oversized
@ ) WITHOUT ROWID;
;
/*
** Make sure the unversioned table exists in the repository.
*/
void unversioned_schema(void){
if( !db_table_exists("repository", "unversioned") ){
db_multi_exec(zUnversionedInit /*works-like:"%w"*/, db_name("repository"));
}
}
/*
** Return a string which is the hash of the unversioned content.
** This is the hash used by repositories to compare content before
** exchanging a catalog. So all repositories must compute this hash
|
|
|
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#include "unversioned.h"
#include <time.h>
/*
** SQL code to implement the tables needed by the unversioned.
*/
static const char zUnversionedInit[] =
@ CREATE TABLE IF NOT EXISTS repository.unversioned(
@ name TEXT PRIMARY KEY, -- Name of the uv file
@ rcvid INTEGER, -- Where received from
@ mtime DATETIME, -- timestamp. Seconds since 1970.
@ hash TEXT, -- Content hash. NULL if a delete marker
@ sz INTEGER, -- size of content after decompression
@ encoding INT, -- 0: plaintext. 1: zlib compressed
@ content BLOB -- content of the file. NULL if oversized
@ ) WITHOUT ROWID;
;
/*
** Make sure the unversioned table exists in the repository.
*/
void unversioned_schema(void){
if( !db_table_exists("repository", "unversioned") ){
db_multi_exec(zUnversionedInit/*works-like:""*/);
}
}
/*
** Return a string which is the hash of the unversioned content.
** This is the hash used by repositories to compare content before
** exchanging a catalog. So all repositories must compute this hash
|