Home | History | Annotate | Download | only in sqlite3

Lines Matching refs:DB_NAME

1 LazyUint8Array_get(idx){if(idx>this.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}});var lazyArray=this;lazyArray.setDataGetter((function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]}));this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperty(lazyArray,"length",{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._length})});Object.defineProperty(lazyArray,"chunkSize",{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize})});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperty(node,"usedBytes",{get:(function(){return this.contents.length})});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach((function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return fn.apply(null,arguments)}}));stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i]}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i)}}return size};node.stream_ops=stream_ops;return node}),createPreloadedFile:(function(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn){Browser.init();var fullname=name?PATH.resolve(PATH.join2(parent,name)):parent;function processData(byteArray){function finish(byteArray){if(!dontCreateFile){FS.createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}if(onload)onload();removeRunDependency("cp "+fullname)}var handled=false;Module["preloadPlugins"].forEach((function(plugin){if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,(function(){if(onerror)onerror();removeRunDependency("cp "+fullname)}));handled=true}}));if(!handled)finish(byteArray)}addRunDependency("cp "+fullname);if(typeof url=="string"){Browser.asyncLoad(url,(function(byteArray){processData(byteArray)}),onerror)}else{processData(url)}}),indexedDB:(function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB}),DB_NAME:(function(){return"EM_FS_"+window.location.pathname}),DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(function(paths,onload,onerror){onload=onload||(function(){});onerror=onerror||(function(){});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=function openRequest_onupgradeneeded(){console.log("creating db");var db=openRequest.result;db.createObjectStore(FS.DB_STORE_NAME)};openRequest.onsuccess=function openRequest_onsuccess(){var db=openRequest.result;var transaction=db.transaction([FS.DB_STORE_NAME],"readwrite");var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach((function(path){var putRequest=files.put(FS.analyzePath(path).object.contents,path);putRequest.onsuccess=function putRequest_onsuccess(){ok++;if(ok+fail==total)finish()};putRequest.onerror=function putRequest_onerror(){fail++;if(ok+fail==total)finish()}}));transaction.onerror=onerror};openRequest.onerror=onerror}),loadFilesFromDB:(function(paths,onload,onerror){onload=onload||(function(){});onerror=onerror||(function(){});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAMEllFunc_iiiiiiii,"nullFunc_iiii":nullFunc_iiii,"nullFunc_viiiiii":nullFunc_viiiiii,"nullFunc_vi":nullFunc_vi,"nullFunc_viiiii":nullFunc_viiiii,"nullFunc_dii":nullFunc_dii,"nullFunc_vid":nullFunc_vid,"nullFunc_di":nullFunc_di,"nullFunc_i":nullFunc_i,"nullFunc_iiiiiiiiii":nullFunc_iiiiiiiiii,"nullFunc_vii":nullFunc_vii,"nullFunc_iiiiiii":nullFunc_iiiiiii,"nullFunc_ii":nullFunc_ii,"nullFunc_viii":nullFunc_viii,"nullFunc_v":nullFunc_v,"nullFunc_iiiiiiiii":nullFunc_iiiiiiiii,"nullFunc_iiiii":nullFunc_iiiii,"nullFunc_viiii":nullFunc_viiii,"nullFunc_iii":nullFunc_iii,"nullFunc_iiid":nullFunc_iiid,"nullFunc_iiiiii":nullFunc_iiiiii,"invoke_iiiiiiii":invoke_iiiiiiii,"invoke_iiii":invoke_iiii,"invoke_viiiiii":invoke_viiiiii,"invoke_vi":invoke_vi,"invoke_viiiii":invoke_viiiii,"invoke_dii":invoke_dii,"invoke_vid":invoke_vid,"invoke_di":invoke_di,"invoke_i":invoke_i,"invoke_iiiiiiiiii":invoke_iiiiiiiiii,"invoke_vii":invoke_vii,"invoke_iiiiiii":invoke_iiiiiii,"invoke_ii":invoke_ii,"invoke_viii":invoke_viii,"invoke_v":invoke_v,"invoke_iiiiiiiii":invoke_iiiiiiiii,"invoke_iiiii":invoke_iiiii,"invoke_viiii":invoke_viiii,"invoke_iii":invoke_iii,"invoke_iiid":invoke_iiid,"invoke_iiiiii":invoke_iiiiii,"_dlerror":_dlerror,"_utimes":_utimes,"_getuid":_getuid,"_send":_send,"_dlsym":_dlsym,"_mknod":_mknod,"_chown":_chown,"_lseek":_lseek,"_emscripten_set_main_loop_timing":_emscripten_set_main_loop_timing,"_access":_access,"_fstat":_fstat,"_chmod":_chmod,"_rmdir":_rmdir,"___assert_fail":___assert_fail,"_usleep":_usleep,"___buildEnvironment":___buildEnvironment,"_fflush":_fflush,"_pwrite":_pwrite,"_strerror_r":_strerror_r,"_localtime_r":_localtime_r,"_tzset":_tzset,"_open":_open,"_getpid":_getpid,"_sbrk":_sbrk,"_fcntl":_fcntl,"_emscripten_memcpy_big":_emscripten_memcpy_big,"_unlink":_unlink,"_sysconf":_sysconf,"_fchmod":_fchmod,"___setErrNo":___setErrNo,"_ftruncate":_ftruncate,"_mkdir":_mkdir,"_pread":_pread,"_mkport":_mkport,"_dlopen":_dlopen,"_dlclose":_dlclose,"_write":_write,"_fsync":_fsync,"___errno_location":___errno_location,"_stat":_stat,"_recv":_recv,"_geteuid":_geteuid,"_getenv":_getenv,"_sleep":_sleep,"_emscripten_set_main_loop":_emscripten_set_main_loop,"_abort":_abort,"_time":_time,"_fchown":_fchown,"_strerror":_strerror,"_gettimeofday":_gettimeofday,"_munmap":_munmap,"_mmap":_mmap,"_localtime":_localtime,"_getcwd":_getcwd,"_close":_close,"_read":_read,"_truncate":_truncate,"STACKTOP":STACKTOP,"STACK_MAX":STACK_MAX,"tempDoublePtr":tempDoublePtr,"ABORT":ABORT,"cttz_i8":cttz_i8};// EMSCRIPTEN_START_ASM