[{"data":1,"prerenderedAt":512},["ShallowReactive",2],{"navigation":3,"\u002Fguide\u002Fdevtools":208,"\u002Fguide\u002Fdevtools-surround":507},[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":85,"body":210,"description":500,"extension":501,"links":502,"meta":503,"navigation":504,"path":81,"seo":505,"stem":82,"__hash__":506},"docs\u002F1.guide\u002F7.devtools\u002F1.index.md",{"type":211,"value":212,"toc":495},"minimark",[213,235,340,360,363,394,399,402,426,429,437,462,465,491],[214,215,216,217,221,222,226,227,234],"p",{},"In ",[218,219,220],"code",{},"nuxt dev",", the module adds a ",[223,224,225],"strong",{},"PGlite"," tab to ",[228,229,233],"a",{"href":230,"rel":231},"https:\u002F\u002Fdevtools.nuxt.com",[232],"nofollow","Nuxt DevTools",". It is on whenever DevTools is, and nothing of it is registered in a build.",[236,237,243],"pre",{"className":238,"code":239,"filename":240,"language":241,"meta":242,"style":242},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  devtools: { enabled: true }, \u002F\u002F Nuxt DevTools itself\n  pglite: {\n    devtools: true, \u002F\u002F the PGlite tab (default)\n  },\n})\n","nuxt.config.ts","ts","",[218,244,245,269,298,309,325,331],{"__ignoreMap":242},[246,247,250,254,257,261,265],"span",{"class":248,"line":249},"line",1,[246,251,253],{"class":252},"s7zQu","export",[246,255,256],{"class":252}," default",[246,258,260],{"class":259},"s2Zo4"," defineNuxtConfig",[246,262,264],{"class":263},"sTEyZ","(",[246,266,268],{"class":267},"sMK4o","{\n",[246,270,272,276,279,282,285,287,291,294],{"class":248,"line":271},2,[246,273,275],{"class":274},"swJcz","  devtools",[246,277,278],{"class":267},":",[246,280,281],{"class":267}," {",[246,283,284],{"class":274}," enabled",[246,286,278],{"class":267},[246,288,290],{"class":289},"sfNiH"," true",[246,292,293],{"class":267}," },",[246,295,297],{"class":296},"sHwdD"," \u002F\u002F Nuxt DevTools itself\n",[246,299,301,304,306],{"class":248,"line":300},3,[246,302,303],{"class":274},"  pglite",[246,305,278],{"class":267},[246,307,308],{"class":267}," {\n",[246,310,312,315,317,319,322],{"class":248,"line":311},4,[246,313,314],{"class":274},"    devtools",[246,316,278],{"class":267},[246,318,290],{"class":289},[246,320,321],{"class":267},",",[246,323,324],{"class":296}," \u002F\u002F the PGlite tab (default)\n",[246,326,328],{"class":248,"line":327},5,[246,329,330],{"class":267},"  },\n",[246,332,334,337],{"class":248,"line":333},6,[246,335,336],{"class":267},"}",[246,338,339],{"class":263},")\n",[214,341,342,345,346,348,349,355,356,359],{},[218,343,344],{},"pglite.devtools"," only toggles the tab. ",[228,347,88],{"href":89}," are defined where they run: in the config files, and under ",[228,350,352],{"href":351},"\u002Fguide\u002Fdevtools\u002Factions#socket-actions",[218,353,354],{},"pglite.socket.devtoolsActions","; the ",[228,357,358],{"href":94},"terminal picker"," works with the tab off.",[214,361,362],{},"The tab has three panes:",[364,365,366,378,384],"ul",{},[367,368,369,372,373,377],"li",{},[223,370,371],{},"Overview",": for the server and the client side, whether it is enabled and eager, the data directory and the extensions. With the socket running, its URL, the number of connected clients and the ",[228,374,376],{"href":375},"\u002Fguide\u002Fsocket#environment-variables","variables it exported",", with their values.",[367,379,380,383],{},[223,381,382],{},"SQL",": a query box for each instance, the server's and the browser's (the latter runs in the app's tab, against its worker). Several statements run at once, each with its own result, up to 500 rows shown per statement. The last 20 queries per instance are kept as history, in the DevTools frame's local storage.",[367,385,386,389,390,393],{},[223,387,388],{},"Tools",": your ",[228,391,392],{"href":89},"actions",", grouped by where they run, each with a button and its last result.",[395,396,398],"h2",{"id":397},"where-the-server-queries-run","Where the server queries run",[214,400,401],{},"The server pane targets the instance that exists:",[364,403,404,410,420],{},[367,405,406,409],{},[223,407,408],{},"With the development socket",", the instance the socket serves, in the Nuxt process. Queries and actions queue with the socket's clients, so they never land inside another client's transaction.",[367,411,412,415,416,419],{},[223,413,414],{},"Without it",", the instance in Nitro, through ",[218,417,418],{},"usePGlite()",", over a development-only endpoint.",[367,421,422,425],{},[223,423,424],{},"With the server side disabled and no socket",", there is no server instance to query.",[214,427,428],{},"The client pane needs the app open: the DevTools frame reaches the app's own instance, and an action or query there creates the worker if the page has not yet.",[395,430,432,433,436],{"id":431},"when-init-fails","When ",[218,434,435],{},"init"," fails",[214,438,439,440,442,443,445,446,449,450,453,454,457,458,461],{},"The socket's instance is created, and ",[218,441,435],{}," run, when ",[218,444,220],{}," starts. When either fails, for example on a migration that does not apply or on ",[228,447,448],{"href":113},"edited migrations",", the dev server keeps running and the socket keeps its URL, but refuses every client with a FATAL ",[218,451,452],{},"57P03"," (",[218,455,456],{},"cannot_connect_now",") error: ",[218,459,460],{},"PGlite is not ready: \u003Cthe error>",", with a hint pointing at the fix. The Overview pane shows the same reason above the server's details.",[214,463,464],{},"Two ways out:",[364,466,467,473],{},[367,468,469,470,472],{},"Fix the cause and restart ",[218,471,220],{},". A change to the config file restarts it by itself.",[367,474,475,476,479,480,487,488,490],{},"Run ",[223,477,478],{},"Reset database"," from the Tools pane: the ",[228,481,483,486],{"href":482},"\u002Fguide\u002Fdevtools\u002Factions#reset-database",[218,484,485],{},"reset-database"," action"," deletes the data directory and creates the instance again, ",[218,489,435],{}," included. If that fails too, the socket keeps refusing clients, with the new reason.",[492,493,494],"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 .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}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);}",{"title":242,"searchDepth":249,"depth":271,"links":496},[497,498],{"id":397,"depth":271,"text":398},{"id":431,"depth":271,"text":499},"When init fails","Inspect each PGlite instance, run SQL against it and trigger your actions from Nuxt DevTools.","md",null,{},{"icon":86},{"title":85,"description":500},"bnXEVrv9iyLPFWa93WcV_dFjmpRjVvlcnFXjncLIwog",[508,510],{"title":75,"path":76,"stem":77,"description":509,"icon":78,"children":-1},"Develop against PGlite with nothing to install, deploy against any Postgres, with the same code and no PGlite in the build.",{"title":88,"path":89,"stem":90,"description":511,"icon":91,"children":-1},"Named operations you run from the DevTools tab, next to the database they need.",1791474259253]