465
466
467
468
469
470
471
472
473
474
475
476
477
478
|
** Look for a file named zName in the check-in with RID=vid. Load the content
** of that file into pContent and return the RID for the file. Or return 0
** if the file is not found or could not be loaded.
*/
int doc_load_content(int vid, const char *zName, Blob *pContent){
int writable = db_is_writeable("repository");
int rid; /* The RID of the file being loaded */
if( !db_table_exists("repository", "vcache") || !writable ){
db_multi_exec(
"CREATE %s TABLE IF NOT EXISTS vcache(\n"
" vid INTEGER, -- check-in ID\n"
" fname TEXT, -- filename\n"
" rid INTEGER, -- artifact ID\n"
" PRIMARY KEY(vid,fname)\n"
|
>
>
>
>
|
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
|
** Look for a file named zName in the check-in with RID=vid. Load the content
** of that file into pContent and return the RID for the file. Or return 0
** if the file is not found or could not be loaded.
*/
int doc_load_content(int vid, const char *zName, Blob *pContent){
int writable = db_is_writeable("repository");
int rid; /* The RID of the file being loaded */
if( writable ){
db_end_transaction(0);
db_begin_write();
}
if( !db_table_exists("repository", "vcache") || !writable ){
db_multi_exec(
"CREATE %s TABLE IF NOT EXISTS vcache(\n"
" vid INTEGER, -- check-in ID\n"
" fname TEXT, -- filename\n"
" rid INTEGER, -- artifact ID\n"
" PRIMARY KEY(vid,fname)\n"
|