var e={version:1,pragmas:[[`busy_timeout`,`30000`],[`journal_mode`,`WAL`],[`synchronous`,`NORMAL`],[`foreign_keys`,`ON`],[`cache_size`,`-64000`],[`mmap_size`,`268435456`],[`temp_store`,`MEMORY`],[`wal_autocheckpoint`,`1000`]]}.pragmas;function t(e){let[t,n]=e;return`PRAGMA ${t} = ${n}`}e.map(t).join(`;
`);function n(t,n={}){let{enableWal:i=!0,enableForeignKeys:a=!{}.VITEST,cacheSizeKb:o,mmapSizeBytes:s,busyTimeoutMs:c}=n;for(let n of e){let[e,l]=n,u=r(e,l,{enableWal:i,enableForeignKeys:a,cacheSizeKb:o,mmapSizeBytes:s,busyTimeoutMs:c});u!==null&&t.exec(`PRAGMA ${e} = ${u}`)}}function r(e,t,n){switch(e){case`journal_mode`:return n.enableWal?t:null;case`foreign_keys`:return n.enableForeignKeys?t:null;case`busy_timeout`:return n.busyTimeoutMs===void 0?t:String(n.busyTimeoutMs);case`cache_size`:return n.cacheSizeKb===void 0?t:`-${n.cacheSizeKb}`;case`mmap_size`:return n.mmapSizeBytes===void 0?t:n.mmapSizeBytes>0?String(n.mmapSizeBytes):null;default:return t}}export{n as t};