[{"data":1,"prerenderedAt":622},["ShallowReactive",2],{"navigation":3,"\u002Fguide\u002Fserver\u002Foptions":208,"\u002Fguide\u002Fserver\u002Foptions-surround":617},[4,98,175],{"title":5,"path":6,"stem":7,"children":8,"icon":97},"Guide","\u002Fguide","1.guide\u002F1.index",[9,12,17,22,46,61,79],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-house",{"title":13,"path":14,"stem":15,"icon":16},"Installation","\u002Fguide\u002Finstallation","1.guide\u002F2.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"Quick start","\u002Fguide\u002Fquick-start","1.guide\u002F3.quick-start","i-lucide-rocket",{"title":23,"path":24,"stem":25,"children":26,"icon":45},"Server","\u002Fguide\u002Fserver","1.guide\u002F4.server\u002F1.index",[27,30,35,40],{"title":28,"path":24,"stem":25,"icon":29},"Usage","i-lucide-server",{"title":31,"path":32,"stem":33,"icon":34},"Config file","\u002Fguide\u002Fserver\u002Fconfig-file","1.guide\u002F4.server\u002F2.config-file","i-lucide-file-cog",{"title":36,"path":37,"stem":38,"icon":39},"Options","\u002Fguide\u002Fserver\u002Foptions","1.guide\u002F4.server\u002F3.options","i-lucide-settings",{"title":41,"path":42,"stem":43,"icon":44},"Advanced","\u002Fguide\u002Fserver\u002Fadvanced","1.guide\u002F4.server\u002F4.advanced","i-lucide-flask-conical",false,{"title":47,"path":48,"stem":49,"children":50,"icon":45},"Client","\u002Fguide\u002Fclient","1.guide\u002F5.client\u002F1.index",[51,53,58],{"title":28,"path":48,"stem":49,"icon":52},"i-lucide-monitor-smartphone",{"title":54,"path":55,"stem":56,"icon":57},"Live queries","\u002Fguide\u002Fclient\u002Flive-queries","1.guide\u002F5.client\u002F2.live-queries","i-lucide-radio",{"title":41,"path":59,"stem":60,"icon":44},"\u002Fguide\u002Fclient\u002Fadvanced","1.guide\u002F5.client\u002F3.advanced",{"title":62,"path":63,"stem":64,"children":65,"icon":45},"Development socket","\u002Fguide\u002Fsocket","1.guide\u002F6.socket\u002F1.index",[66,68,71,74],{"title":28,"path":63,"stem":64,"icon":67},"i-lucide-plug",{"title":36,"path":69,"stem":70,"icon":39},"\u002Fguide\u002Fsocket\u002Foptions","1.guide\u002F6.socket\u002F2.options",{"title":41,"path":72,"stem":73,"icon":44},"\u002Fguide\u002Fsocket\u002Fadvanced","1.guide\u002F6.socket\u002F3.advanced",{"title":75,"path":76,"stem":77,"icon":78},"PGlite in dev, Postgres in prod","\u002Fguide\u002Fsocket\u002Fdevelopment-only","1.guide\u002F6.socket\u002F4.development-only","i-lucide-cloud-upload",{"title":80,"path":81,"stem":82,"children":83,"icon":45},"DevTools & tooling","\u002Fguide\u002Fdevtools","1.guide\u002F7.devtools\u002F1.index",[84,87,92],{"title":85,"path":81,"stem":82,"icon":86},"DevTools tab","i-lucide-wrench",{"title":88,"path":89,"stem":90,"icon":91},"Actions","\u002Fguide\u002Fdevtools\u002Factions","1.guide\u002F7.devtools\u002F2.actions","i-lucide-zap",{"title":93,"path":94,"stem":95,"icon":96},"Terminal","\u002Fguide\u002Fdevtools\u002Fterminal","1.guide\u002F7.devtools\u002F3.terminal","i-lucide-square-terminal","i-lucide-book-open",{"title":99,"icon":100,"path":101,"stem":102,"children":103,"page":45},"Recipes","i-lucide-chef-hat","\u002Frecipes","2.recipes",[104,116,138,159,171],{"title":105,"path":106,"stem":107,"children":108,"icon":45},"Migrations","\u002Frecipes\u002Fmigrations","2.recipes\u002F1.migrations\u002F1.index",[109,111],{"title":28,"path":106,"stem":107,"icon":110},"i-lucide-database-backup",{"title":112,"path":113,"stem":114,"icon":115},"Edited migrations","\u002Frecipes\u002Fmigrations\u002Fedited-migrations","2.recipes\u002F1.migrations\u002F2.edited-migrations","i-lucide-file-diff",{"title":117,"path":118,"stem":119,"children":120,"icon":45},"Testing","\u002Frecipes\u002Ftesting","2.recipes\u002F2.testing\u002F1.index",[121,123,128,133],{"title":28,"path":118,"stem":119,"icon":122},"i-lucide-test-tube",{"title":124,"path":125,"stem":126,"icon":127},"Isolation","\u002Frecipes\u002Ftesting\u002Fisolation","2.recipes\u002F2.testing\u002F2.isolation","i-lucide-git-fork",{"title":129,"path":130,"stem":131,"icon":132},"vitest","\u002Frecipes\u002Ftesting\u002Fvitest","2.recipes\u002F2.testing\u002F3.vitest","i-simple-icons-vitest",{"title":134,"path":135,"stem":136,"icon":137},"@nuxt\u002Ftest-utils","\u002Frecipes\u002Ftesting\u002Fnuxt-test-utils","2.recipes\u002F2.testing\u002F4.nuxt-test-utils","i-simple-icons-nuxt",{"title":139,"path":140,"stem":141,"children":142,"icon":45},"Deploy","\u002Frecipes\u002Fdeploy","2.recipes\u002F3.deploy\u002F1.index",[143,144,149,154],{"title":139,"path":140,"stem":141},{"title":145,"path":146,"stem":147,"icon":148},"Any Postgres","\u002Frecipes\u002Fdeploy\u002Fpostgres","2.recipes\u002F3.deploy\u002F2.postgres","i-lucide-database",{"title":150,"path":151,"stem":152,"icon":153},"Netlify","\u002Frecipes\u002Fdeploy\u002Fnetlify","2.recipes\u002F3.deploy\u002F3.netlify","i-simple-icons-netlify",{"title":155,"path":156,"stem":157,"icon":158},"Neon","\u002Frecipes\u002Fdeploy\u002Fneon","2.recipes\u002F3.deploy\u002F4.neon","i-simple-icons-neon",{"title":160,"path":161,"stem":162,"children":163,"icon":45},"Outside Nuxt","\u002Frecipes\u002Foutside-nuxt","2.recipes\u002F4.outside-nuxt\u002F1.index",[164,167],{"title":165,"path":161,"stem":162,"icon":166},"Config and provider","i-lucide-package",{"title":168,"path":169,"stem":170,"icon":67},"Socket server","\u002Frecipes\u002Foutside-nuxt\u002Fsocket","2.recipes\u002F4.outside-nuxt\u002F2.socket",{"title":172,"path":173,"stem":174,"icon":67},"Nitro's useDatabase","\u002Frecipes\u002Fnitro-database","2.recipes\u002F5.nitro-database",{"title":176,"icon":177,"path":178,"stem":179,"children":180,"page":45},"Reference","i-lucide-code-xml","\u002Freference","3.reference",[181,185,189,193,198,203],{"title":182,"path":183,"stem":184,"icon":34},"Config files","\u002Freference\u002Fconfig-files","3.reference\u002F1.config-files",{"title":186,"path":187,"stem":188,"icon":39},"Module options","\u002Freference\u002Fmodule-options","3.reference\u002F2.module-options",{"title":190,"path":191,"stem":192,"icon":67},"Socket options","\u002Freference\u002Fsocket-options","3.reference\u002F3.socket-options",{"title":194,"path":195,"stem":196,"icon":197},"Exports","\u002Freference\u002Fexports","3.reference\u002F4.exports","i-lucide-boxes",{"title":199,"path":200,"stem":201,"icon":202},"Hooks","\u002Freference\u002Fhooks","3.reference\u002F5.hooks","i-lucide-anchor",{"title":204,"path":205,"stem":206,"icon":207},"Environment","\u002Freference\u002Fenvironment","3.reference\u002F6.environment","i-lucide-variable",{"id":209,"title":36,"body":210,"description":610,"extension":611,"links":612,"meta":613,"navigation":614,"path":37,"seo":615,"stem":38,"__hash__":616},"docs\u002F1.guide\u002F4.server\u002F3.options.md",{"type":211,"value":212,"toc":602},"minimark",[213,366,372,400,405,418,423,448,458,463,473,485,490,499,523,527,534,537,595,598],[214,215,221],"pre",{"className":216,"code":217,"filename":218,"language":219,"meta":220,"style":220},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  pglite: {\n    server: {\n      enabled: true,\n      config: 'server\u002Fpglite.config',\n      options: { dataDir: '.data\u002Fpglite' },\n      eager: false,\n    },\n  },\n})\n","nuxt.config.ts","ts","",[222,223,224,248,261,271,286,306,332,345,351,357],"code",{"__ignoreMap":220},[225,226,229,233,236,240,244],"span",{"class":227,"line":228},"line",1,[225,230,232],{"class":231},"s7zQu","export",[225,234,235],{"class":231}," default",[225,237,239],{"class":238},"s2Zo4"," defineNuxtConfig",[225,241,243],{"class":242},"sTEyZ","(",[225,245,247],{"class":246},"sMK4o","{\n",[225,249,251,255,258],{"class":227,"line":250},2,[225,252,254],{"class":253},"swJcz","  pglite",[225,256,257],{"class":246},":",[225,259,260],{"class":246}," {\n",[225,262,264,267,269],{"class":227,"line":263},3,[225,265,266],{"class":253},"    server",[225,268,257],{"class":246},[225,270,260],{"class":246},[225,272,274,277,279,283],{"class":227,"line":273},4,[225,275,276],{"class":253},"      enabled",[225,278,257],{"class":246},[225,280,282],{"class":281},"sfNiH"," true",[225,284,285],{"class":246},",\n",[225,287,289,292,294,297,301,304],{"class":227,"line":288},5,[225,290,291],{"class":253},"      config",[225,293,257],{"class":246},[225,295,296],{"class":246}," '",[225,298,300],{"class":299},"sfazB","server\u002Fpglite.config",[225,302,303],{"class":246},"'",[225,305,285],{"class":246},[225,307,309,312,314,317,320,322,324,327,329],{"class":227,"line":308},6,[225,310,311],{"class":253},"      options",[225,313,257],{"class":246},[225,315,316],{"class":246}," {",[225,318,319],{"class":253}," dataDir",[225,321,257],{"class":246},[225,323,296],{"class":246},[225,325,326],{"class":299},".data\u002Fpglite",[225,328,303],{"class":246},[225,330,331],{"class":246}," },\n",[225,333,335,338,340,343],{"class":227,"line":334},7,[225,336,337],{"class":253},"      eager",[225,339,257],{"class":246},[225,341,342],{"class":281}," false",[225,344,285],{"class":246},[225,346,348],{"class":227,"line":347},8,[225,349,350],{"class":246},"    },\n",[225,352,354],{"class":227,"line":353},9,[225,355,356],{"class":246},"  },\n",[225,358,360,363],{"class":227,"line":359},10,[225,361,362],{"class":246},"}",[225,364,365],{"class":242},")\n",[367,368,370],"h3",{"id":369},"enabled",[222,371,369],{},[373,374,375,378,379,382,383,386,387,390,391,394,395,399],"p",{},[222,376,377],{},"boolean",", default ",[222,380,381],{},"true",". Registers ",[222,384,385],{},"usePGlite()"," and puts PGlite in the server bundle. With ",[222,388,389],{},"false",", nothing of PGlite is bundled and ",[222,392,393],{},"#pglite\u002Fserver"," resolves to a stub; the ",[396,397,398],"a",{"href":63},"development socket"," still works.",[367,401,403],{"id":402},"config",[222,404,402],{},[373,406,407,378,410,413,414,417],{},[222,408,409],{},"string",[222,411,412],{},"'server\u002Fpglite.config'",". Path of the ",[396,415,416],{"href":32},"config file",", relative to the root directory, extension optional. A config file that exists while the server side is disabled and has no socket logs a warning, since nothing uses it.",[367,419,421],{"id":420},"options",[222,422,420],{},[373,424,425,426,429,430,433,434,433,437,433,440,443,444,447],{},"PGlite options, default ",[222,427,428],{},"{}",". Build-time defaults the config file can override, limited to what survives serialization into the build: no ",[222,431,432],{},"extensions",", ",[222,435,436],{},"fs",[222,438,439],{},"loadDataDir",[222,441,442],{},"parsers"," or ",[222,445,446],{},"serializers"," (those go in the config file).",[373,449,450,451,454,455,457],{},"A relative ",[222,452,453],{},"options.dataDir"," is resolved from the root directory at build time, and its parent directories are created. Unset, it is ",[222,456,326],{},".",[367,459,461],{"id":460},"eager",[222,462,460],{},[373,464,465,378,467,469,470,472],{},[222,466,377],{},[222,468,389],{},". Creates the instance when the server starts instead of on the first ",[222,471,385],{},", so the first request does not pay for it.",[474,475,476],"note",{},[373,477,478,479,484],{},"The development socket is not a server option: it is configured at the root, as ",[396,480,481],{"href":69},[222,482,483],{},"pglite.socket",", and works with the server side disabled.",[486,487,489],"h2",{"id":488},"runtime-overrides","Runtime overrides",[373,491,492,495,496,498],{},[222,493,494],{},"NUXT_PGLITE_DATA_DIR"," sets the data directory at runtime, winning over both ",[222,497,218],{}," and the config file. A relative path is resolved from the working directory of the server process:",[214,500,504],{"className":501,"code":502,"filename":93,"language":503,"meta":220,"style":220},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","NUXT_PGLITE_DATA_DIR=\u002Fvar\u002Flib\u002Fmy-app\u002Fpglite node .output\u002Fserver\u002Findex.mjs\n","bash",[222,505,506],{"__ignoreMap":220},[225,507,508,510,513,516,520],{"class":227,"line":228},[225,509,494],{"class":242},[225,511,512],{"class":246},"=",[225,514,515],{"class":299},"\u002Fvar\u002Flib\u002Fmy-app\u002Fpglite",[225,517,519],{"class":518},"sBMFI"," node",[225,521,522],{"class":299}," .output\u002Fserver\u002Findex.mjs\n",[486,524,526],{"id":525},"nuxt-5-and-nitro-3","Nuxt 5 and Nitro 3",[373,528,529,530,533],{},"On Nitro 3, server dependencies are bundled. A bundled PGlite would be separated from the WebAssembly and extension files it loads at runtime, so the module keeps it whole: ",[222,531,532],{},"@electric-sql\u002Fpglite*"," and every package your server config file imports (relative imports included) are traced as complete packages.",[373,535,536],{},"A package that reaches PGlite some other way, and needs to stay whole for the same reason, goes in Nitro's own list:",[214,538,540],{"className":216,"code":539,"filename":218,"language":219,"meta":220,"style":220},"export default defineNuxtConfig({\n  nitro: {\n    traceDeps: ['my-pglite-extension'],\n  },\n})\n",[222,541,542,554,563,585,589],{"__ignoreMap":220},[225,543,544,546,548,550,552],{"class":227,"line":228},[225,545,232],{"class":231},[225,547,235],{"class":231},[225,549,239],{"class":238},[225,551,243],{"class":242},[225,553,247],{"class":246},[225,555,556,559,561],{"class":227,"line":250},[225,557,558],{"class":253},"  nitro",[225,560,257],{"class":246},[225,562,260],{"class":246},[225,564,565,568,570,573,575,578,580,583],{"class":227,"line":263},[225,566,567],{"class":253},"    traceDeps",[225,569,257],{"class":246},[225,571,572],{"class":242}," [",[225,574,303],{"class":246},[225,576,577],{"class":299},"my-pglite-extension",[225,579,303],{"class":246},[225,581,582],{"class":242},"]",[225,584,285],{"class":246},[225,586,587],{"class":227,"line":273},[225,588,356],{"class":246},[225,590,591,593],{"class":227,"line":288},[225,592,362],{"class":246},[225,594,365],{"class":242},[373,596,597],{},"On Nitro 2 (Nuxt 4) dependencies stay external and none of this applies.",[599,600,601],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":220,"searchDepth":228,"depth":250,"links":603},[604,605,606,607,608,609],{"id":369,"depth":263,"text":369},{"id":402,"depth":263,"text":402},{"id":420,"depth":263,"text":420},{"id":460,"depth":263,"text":460},{"id":488,"depth":250,"text":489},{"id":525,"depth":250,"text":526},"The pglite.server options in nuxt.config.ts, runtime overrides and Nuxt 5.","md",null,{},{"icon":39},{"title":36,"description":610},"W964vcrdyM9WADwNufkFOwqA4kado_2F8Tvh_Tw-iww",[618,620],{"title":31,"path":32,"stem":33,"description":619,"icon":34,"children":-1},"Extensions, init, dispose and per-environment settings in server\u002Fpglite.config.ts.",{"title":41,"path":42,"stem":43,"description":621,"icon":44,"children":-1},"Explicit imports, the provider behind usePGlite() and how the instance lives.",1791474260495]