[{"data":1,"prerenderedAt":468},["ShallowReactive",2],{"navigation":3,"-connectors-pglite":104,"-connectors-pglite-surround":463},[4,21,82],{"title":5,"path":6,"stem":7,"children":8,"icon":10},"Getting Started","/guide","1.guide/1.index",[9,11,16],{"title":5,"path":6,"stem":7,"icon":10},"ph:book-open-duotone",{"title":12,"path":13,"stem":14,"icon":15},"HTTP Server","/guide/http-server","1.guide/3.http-server","material-symbols:http",{"title":17,"path":18,"stem":19,"icon":20},"Custom Connectors","/guide/custom-connector","1.guide/4.custom-connector","material-symbols-light:dashboard-customize",{"title":22,"path":23,"stem":24,"children":25,"icon":27},"Connectors","/connectors","2.connectors/1.index",[26,28,33,38,43,48,53,58,63,67,72,77],{"title":22,"path":23,"stem":24,"icon":27},"gravity-ui:plug-connection",{"title":29,"path":30,"stem":31,"icon":32},"Bun SQlite","/connectors/bun","2.connectors/bun","simple-icons:bun",{"title":34,"path":35,"stem":36,"icon":37},"Cloudflare","/connectors/cloudflare","2.connectors/cloudflare","devicon-plain:cloudflareworkers",{"title":39,"path":40,"stem":41,"icon":42},"LibSQL","/connectors/libsql","2.connectors/libsql","clarity:node-line",{"title":44,"path":45,"stem":46,"icon":47},"MySQL","/connectors/mysql","2.connectors/mysql","simple-icons:mysql",{"title":49,"path":50,"stem":51,"icon":52},"NEON","/connectors/neon","2.connectors/neon","cbi:neon",{"title":54,"path":55,"stem":56,"icon":57},"PGlite","/connectors/pglite","2.connectors/pglite","simple-icons:postgresql",{"title":59,"path":60,"stem":61,"icon":62},"PlanetScale","/connectors/planetscale","2.connectors/planetscale","simple-icons:planetscale",{"title":64,"path":65,"stem":66,"icon":57},"PostgreSQL","/connectors/postgresql","2.connectors/postgresql",{"title":68,"path":69,"stem":70,"icon":71},"SQLite","/connectors/sqlite","2.connectors/sqlite","simple-icons:sqlite",{"title":73,"path":74,"stem":75,"icon":76},"Turso","/connectors/turso","2.connectors/turso","simple-icons:turso",{"title":78,"path":79,"stem":80,"icon":81},"Vercel","/connectors/vercel","2.connectors/vercel","radix-icons:vercel-logo",{"title":83,"path":84,"stem":85,"children":86,"icon":88},"Integrations","/integrations","3.integrations/1.index",[87,89,94,99],{"title":83,"path":84,"stem":85,"icon":88},"carbon:property-relationship",{"title":90,"path":91,"stem":92,"icon":93},"Drizzle","/integrations/drizzle","3.integrations/drizzle","simple-icons:drizzle",{"title":95,"path":96,"stem":97,"icon":98},"Kysely","/integrations/kysely","3.integrations/kysely","mynaui:letter-k",{"title":100,"path":101,"stem":102,"icon":103},"Prisma","/integrations/prisma","3.integrations/prisma","simple-icons:prisma",{"id":105,"title":54,"body":106,"description":457,"extension":458,"meta":459,"navigation":460,"path":55,"seo":461,"stem":56,"__hash__":462},"content/2.connectors/pglite.md",{"type":107,"value":108,"toc":450,"icon":57},"minimark",[109,113,118,133,136,143,245,249,256,259,289,294,300,303,312,317,320,327,333,336,343,348,358,364,370,377,384,389,392,399,404,407,413,418,424,430,436,439,446],[110,111],"read-more",{"to":112},"https://pglite.dev",[114,115,117],"h2",{"id":116},"usage","Usage",[119,120,121,122,132],"p",{},"For this connector, you need to install ",[123,124,128],"a",{"href":125,"rel":126},"https://www.npmjs.com/package/@electric-sql/pglite",[127],"nofollow",[129,130,131],"code",{},"@electric-sql/pglite"," dependency:",[134,135],"pm-i",{"name":131},[119,137,138,139,142],{},"Use ",[129,140,141],{},"pglite"," connector:",[144,145,150],"pre",{"className":146,"code":147,"language":148,"meta":149,"style":149},"language-js shiki shiki-themes github-light github-dark github-dark","import { createDatabase } from \"db0\";\nimport pglite from \"db0/connectors/pglite\";\n\nconst db = createDatabase(\n  pglite({\n    /* options */\n  }),\n);\n","js","",[129,151,152,175,190,197,217,226,233,239],{"__ignoreMap":149},[153,154,157,161,165,168,172],"span",{"class":155,"line":156},"line",1,[153,158,160],{"class":159},"so5gQ","import",[153,162,164],{"class":163},"slsVL"," { createDatabase } ",[153,166,167],{"class":159},"from",[153,169,171],{"class":170},"sfrk1"," \"db0\"",[153,173,174],{"class":163},";\n",[153,176,178,180,183,185,188],{"class":155,"line":177},2,[153,179,160],{"class":159},[153,181,182],{"class":163}," pglite ",[153,184,167],{"class":159},[153,186,187],{"class":170}," \"db0/connectors/pglite\"",[153,189,174],{"class":163},[153,191,193],{"class":155,"line":192},3,[153,194,196],{"emptyLinePlaceholder":195},true,"\n",[153,198,200,203,207,210,214],{"class":155,"line":199},4,[153,201,202],{"class":159},"const",[153,204,206],{"class":205},"suiK_"," db",[153,208,209],{"class":159}," =",[153,211,213],{"class":212},"shcOC"," createDatabase",[153,215,216],{"class":163},"(\n",[153,218,220,223],{"class":155,"line":219},5,[153,221,222],{"class":212},"  pglite",[153,224,225],{"class":163},"({\n",[153,227,229],{"class":155,"line":228},6,[153,230,232],{"class":231},"sCsY4","    /* options */\n",[153,234,236],{"class":155,"line":235},7,[153,237,238],{"class":163},"  }),\n",[153,240,242],{"class":155,"line":241},8,[153,243,244],{"class":163},");\n",[114,246,248],{"id":247},"options","Options",[250,251,253],"h3",{"id":252},"datadir",[129,254,255],{},"dataDir",[119,257,258],{},"Path to the directory for storing the Postgres database. You can provide a URI scheme for various storage backends:",[260,261,262,273,281],"ul",{},[263,264,265,272],"li",{},[266,267,268,271],"strong",{},[129,269,270],{},"file://"," or unprefixed",": File system storage, available in Node and Bun.",[263,274,275,280],{},[266,276,277],{},[129,278,279],{},"idb://",": IndexedDB storage, available in the browser.",[263,282,283,288],{},[266,284,285],{},[129,286,287],{},"memory://",": In-memory ephemeral storage, available on all platforms.",[250,290,292],{"id":291},"options-1",[129,293,247],{},[295,296,298],"h4",{"id":297},"datadir-1",[129,299,255],{},[119,301,302],{},"The directory in which to store the Postgres database when not provided as the first argument.",[119,304,305,308,309],{},[266,306,307],{},"Type:"," ",[129,310,311],{},"string",[295,313,315],{"id":314},"debug",[129,316,314],{},[119,318,319],{},"Postgres debug level. Logs are sent to the console.",[119,321,322,308,324],{},[266,323,307],{},[129,325,326],{},"1 | 2 | 3 | 4 | 5",[295,328,330],{"id":329},"relaxeddurability",[129,331,332],{},"relaxedDurability",[119,334,335],{},"Under relaxed durability mode, PGlite will not wait for flushes to storage to complete after each query before returning results. This is particularly useful when using the IndexedDB file system.",[119,337,338,308,340],{},[266,339,307],{},[129,341,342],{},"boolean",[295,344,346],{"id":345},"fs",[129,347,345],{},[119,349,350,351,353,354,357],{},"An alternative to providing a ",[129,352,255],{}," with a filesystem prefix. Initialize a ",[129,355,356],{},"Filesystem"," yourself and provide it here.",[119,359,360,308,362],{},[266,361,307],{},[129,363,356],{},[295,365,367],{"id":366},"loaddatadir",[129,368,369],{},"loadDataDir",[119,371,372,373,376],{},"A tarball of a PGlite datadir to load when the database starts. This should be a tarball produced from the related ",[129,374,375],{},".dumpDataDir()"," method.",[119,378,379,308,381],{},[266,380,307],{},[129,382,383],{},"Blob | File",[295,385,387],{"id":386},"extensions",[129,388,386],{},[119,390,391],{},"An object containing the extensions you wish to load.",[119,393,394,308,396],{},[266,395,307],{},[129,397,398],{},"{ [namespace: string]: Extension }",[295,400,402],{"id":401},"username",[129,403,401],{},[119,405,406],{},"The username of the user to connect to the database as. Permissions will be applied in the context of this user.",[119,408,409,308,411],{},[266,410,307],{},[129,412,311],{},[295,414,416],{"id":415},"database",[129,417,415],{},[119,419,420,421,423],{},"The database from the Postgres cluster within the ",[129,422,255],{}," to connect to.",[119,425,426,308,428],{},[266,427,307],{},[129,429,311],{},[295,431,433],{"id":432},"initialmemory",[129,434,435],{},"initialMemory",[119,437,438],{},"The initial amount of memory in bytes to allocate for the PGlite instance. PGlite will grow the memory automatically, but if you have a particularly large database, you can set this higher to prevent the pause during memory growth.",[119,440,441,308,443],{},[266,442,307],{},[129,444,445],{},"number",[447,448,449],"style",{},"html pre.shiki code .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}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":149,"searchDepth":177,"depth":177,"links":451},[452,453],{"id":116,"depth":177,"text":117},{"id":247,"depth":177,"text":248,"children":454},[455,456],{"id":252,"depth":192,"text":255},{"id":291,"depth":192,"text":247},"Connect DB0 to Postgres using PGlite","md",{"icon":57},{"icon":57},{"title":54,"description":457},"k9OPDMT3taoCTJbO0zXnJ6pYfLiJbyJ7qk1SfKuN3LY",[464,466],{"title":49,"path":50,"stem":51,"description":465,"icon":52,"children":-1},"Connect DB0 to Neon Serverless Postgres.",{"title":59,"path":60,"stem":61,"description":467,"icon":62,"children":-1},"Connect DB0 to Planetscale",1780492438331]