[{"data":1,"prerenderedAt":439},["ShallowReactive",2],{"navigation":3,"-drivers-planetscale":137,"-drivers-planetscale-surround":435},[4,26],{"title":5,"path":6,"stem":7,"children":8,"icon":10},"Getting Started","\u002Fguide","1.guide\u002F1.index",[9,11,16,21],{"title":5,"path":6,"stem":7,"icon":10},"ph:book-open-duotone",{"title":12,"path":13,"stem":14,"icon":15},"Utilities","\u002Fguide\u002Futils","1.guide\u002F2.utils","et:tools-2",{"title":17,"path":18,"stem":19,"icon":20},"HTTP Server","\u002Fguide\u002Fhttp-server","1.guide\u002F3.http-server","ic:baseline-http",{"title":22,"path":23,"stem":24,"icon":25},"Custom Driver","\u002Fguide\u002Fcustom-driver","1.guide\u002F4.custom-driver","carbon:area-custom",{"title":27,"path":28,"stem":29,"children":30,"icon":32},"Drivers","\u002Fdrivers","2.drivers\u002F0.index",[31,33,38,43,48,53,58,63,68,73,77,82,87,92,97,102,107,112,117,122,127,132],{"title":27,"path":28,"stem":29,"icon":32},"icon-park-outline:hard-disk",{"title":34,"path":35,"stem":36,"icon":37},"Azure","\u002Fdrivers\u002Fazure","2.drivers\u002Fazure","mdi:microsoft-azure",{"title":39,"path":40,"stem":41,"icon":42},"Browser","\u002Fdrivers\u002Fbrowser","2.drivers\u002Fbrowser","ph:browser-thin",{"title":44,"path":45,"stem":46,"icon":47},"Capacitor Preferences","\u002Fdrivers\u002Fcapacitor-preferences","2.drivers\u002Fcapacitor-preferences","nonicons:capacitor-16",{"title":49,"path":50,"stem":51,"icon":52},"Cloudflare","\u002Fdrivers\u002Fcloudflare","2.drivers\u002Fcloudflare","devicon-plain:cloudflareworkers",{"title":54,"path":55,"stem":56,"icon":57},"SQL Database","\u002Fdrivers\u002Fdatabase","2.drivers\u002Fdatabase","ph:database",{"title":59,"path":60,"stem":61,"icon":62},"Deno KV","\u002Fdrivers\u002Fdeno","2.drivers\u002Fdeno","simple-icons:deno",{"title":64,"path":65,"stem":66,"icon":67},"Filesystem (Node.js)","\u002Fdrivers\u002Ffs","2.drivers\u002Ffs","ph:file-light",{"title":69,"path":70,"stem":71,"icon":72},"GitHub","\u002Fdrivers\u002Fgithub","2.drivers\u002Fgithub","mdi:github",{"title":74,"path":75,"stem":76,"icon":20},"HTTP","\u002Fdrivers\u002Fhttp","2.drivers\u002Fhttp",{"title":78,"path":79,"stem":80,"icon":81},"LRU Cache","\u002Fdrivers\u002Flru-cache","2.drivers\u002Flru-cache","material-symbols:cached-rounded",{"title":83,"path":84,"stem":85,"icon":86},"Memory","\u002Fdrivers\u002Fmemory","2.drivers\u002Fmemory","bi:memory",{"title":88,"path":89,"stem":90,"icon":91},"MongoDB","\u002Fdrivers\u002Fmongodb","2.drivers\u002Fmongodb","teenyicons:mongodb-outline",{"title":93,"path":94,"stem":95,"icon":96},"Netlify Blobs","\u002Fdrivers\u002Fnetlify","2.drivers\u002Fnetlify","teenyicons:netlify-solid",{"title":98,"path":99,"stem":100,"icon":101},"Null","\u002Fdrivers\u002Fnull","2.drivers\u002Fnull","bi:trash3-fill",{"title":103,"path":104,"stem":105,"icon":106},"Overlay","\u002Fdrivers\u002Foverlay","2.drivers\u002Foverlay","carbon:overlay",{"title":108,"path":109,"stem":110,"icon":111},"PlanetScale","\u002Fdrivers\u002Fplanetscale","2.drivers\u002Fplanetscale","simple-icons:planetscale",{"title":113,"path":114,"stem":115,"icon":116},"Redis","\u002Fdrivers\u002Fredis","2.drivers\u002Fredis","simple-icons:redis",{"title":118,"path":119,"stem":120,"icon":121},"S3","\u002Fdrivers\u002Fs3","2.drivers\u002Fs3","simple-icons:amazons3",{"title":123,"path":124,"stem":125,"icon":126},"UploadThing","\u002Fdrivers\u002Fuploadthing","2.drivers\u002Fuploadthing","qlementine-icons:cloud-16",{"title":128,"path":129,"stem":130,"icon":131},"Upstash","\u002Fdrivers\u002Fupstash","2.drivers\u002Fupstash","simple-icons:upstash",{"title":133,"path":134,"stem":135,"icon":136},"Vercel","\u002Fdrivers\u002Fvercel","2.drivers\u002Fvercel","gg:vercel",{"id":138,"title":108,"body":139,"description":429,"extension":430,"meta":431,"navigation":432,"path":109,"seo":433,"stem":110,"__hash__":434},"content\u002F2.drivers\u002Fplanetscale.md",{"type":140,"value":141,"toc":426,"icon":111},"minimark",[142,147,159,166,184,191,244,251,259,262,378,383,422],[143,144,146],"h2",{"id":145},"usage","Usage",[148,149,150,154,155],"p",{},[151,152,153],"strong",{},"Driver name:"," ",[156,157,158],"code",{},"planetscale",[160,161,163],"read-more",{"to":162},"https:\u002F\u002Fplanetscale.com\u002F",[148,164,165],{},"Learn more about PlanetScale.",[148,167,168,169,172,173,172,176,179,180,183],{},"This driver stores KV information in a Planetscale DB with columns of ",[156,170,171],{},"id",", ",[156,174,175],{},"value",[156,177,178],{},"created_at"," and ",[156,181,182],{},"updated_at",".",[148,185,186,187,190],{},"To use, you will need to install ",[156,188,189],{},"@planetscale\u002Fdatabase"," in your project:",[192,193,198],"pre",{"className":194,"code":195,"language":196,"meta":197,"style":197},"language-json shiki shiki-themes github-light github-dark github-dark","{\n  \"dependencies\": {\n    \"@planetscale\u002Fdatabase\": \"^1.5.0\"\n  }\n}\n","json","",[156,199,200,209,219,232,238],{"__ignoreMap":197},[201,202,205],"span",{"class":203,"line":204},"line",1,[201,206,208],{"class":207},"slsVL","{\n",[201,210,212,216],{"class":203,"line":211},2,[201,213,215],{"class":214},"suiK_","  \"dependencies\"",[201,217,218],{"class":207},": {\n",[201,220,222,225,228],{"class":203,"line":221},3,[201,223,224],{"class":214},"    \"@planetscale\u002Fdatabase\"",[201,226,227],{"class":207},": ",[201,229,231],{"class":230},"sfrk1","\"^1.5.0\"\n",[201,233,235],{"class":203,"line":234},4,[201,236,237],{"class":207},"  }\n",[201,239,241],{"class":203,"line":240},5,[201,242,243],{"class":207},"}\n",[148,245,246,247,250],{},"Then you can create a table to store your data by running the following query in your Planetscale database, where ",[156,248,249],{},"\u003Cstorage>"," is the name of the table you want to use:",[192,252,257],{"className":253,"code":255,"language":256},[254],"language-text","create table \u003Cstorage> (\n id varchar(255) not null primary key,\n value longtext,\n created_at timestamp default current_timestamp,\n updated_at timestamp default current_timestamp on update current_timestamp\n);\n","text",[156,258,255],{"__ignoreMap":197},[148,260,261],{},"You can then configure the driver like this:",[192,263,267],{"className":264,"code":265,"language":266,"meta":197,"style":197},"language-js shiki shiki-themes github-light github-dark github-dark","import { createStorage } from \"unstorage\";\nimport planetscaleDriver from \"unstorage\u002Fdrivers\u002Fplanetscale\";\n\nconst storage = createStorage({\n  driver: planetscaleDriver({\n    \u002F\u002F This should certainly not be inlined in your code but loaded via runtime config\n    \u002F\u002F or environment variables depending on your framework\u002Fproject.\n    url: \"mysql:\u002F\u002Fxxxxxxxxx:************@xxxxxxxxxx.us-east-3.psdb.cloud\u002Fmy-database?sslaccept=strict\",\n    \u002F\u002F table: 'storage'\n  }),\n});\n","js",[156,268,269,287,301,307,325,335,342,348,360,366,372],{"__ignoreMap":197},[201,270,271,275,278,281,284],{"class":203,"line":204},[201,272,274],{"class":273},"so5gQ","import",[201,276,277],{"class":207}," { createStorage } ",[201,279,280],{"class":273},"from",[201,282,283],{"class":230}," \"unstorage\"",[201,285,286],{"class":207},";\n",[201,288,289,291,294,296,299],{"class":203,"line":211},[201,290,274],{"class":273},[201,292,293],{"class":207}," planetscaleDriver ",[201,295,280],{"class":273},[201,297,298],{"class":230}," \"unstorage\u002Fdrivers\u002Fplanetscale\"",[201,300,286],{"class":207},[201,302,303],{"class":203,"line":221},[201,304,306],{"emptyLinePlaceholder":305},true,"\n",[201,308,309,312,315,318,322],{"class":203,"line":234},[201,310,311],{"class":273},"const",[201,313,314],{"class":214}," storage",[201,316,317],{"class":273}," =",[201,319,321],{"class":320},"shcOC"," createStorage",[201,323,324],{"class":207},"({\n",[201,326,327,330,333],{"class":203,"line":240},[201,328,329],{"class":207},"  driver: ",[201,331,332],{"class":320},"planetscaleDriver",[201,334,324],{"class":207},[201,336,338],{"class":203,"line":337},6,[201,339,341],{"class":340},"sCsY4","    \u002F\u002F This should certainly not be inlined in your code but loaded via runtime config\n",[201,343,345],{"class":203,"line":344},7,[201,346,347],{"class":340},"    \u002F\u002F or environment variables depending on your framework\u002Fproject.\n",[201,349,351,354,357],{"class":203,"line":350},8,[201,352,353],{"class":207},"    url: ",[201,355,356],{"class":230},"\"mysql:\u002F\u002Fxxxxxxxxx:************@xxxxxxxxxx.us-east-3.psdb.cloud\u002Fmy-database?sslaccept=strict\"",[201,358,359],{"class":207},",\n",[201,361,363],{"class":203,"line":362},9,[201,364,365],{"class":340},"    \u002F\u002F table: 'storage'\n",[201,367,369],{"class":203,"line":368},10,[201,370,371],{"class":207},"  }),\n",[201,373,375],{"class":203,"line":374},11,[201,376,377],{"class":207},"});\n",[148,379,380],{},[151,381,382],{},"Options:",[384,385,386,402,411],"ul",{},[387,388,389,394,395,183],"li",{},[151,390,391],{},[156,392,393],{},"url"," (required): You can find your URL in the ",[396,397,401],"a",{"href":398,"rel":399},"https:\u002F\u002Fplanetscale.com\u002Fdocs\u002Ftutorials\u002Fconnect-nodejs-app",[400],"nofollow","Planetscale dashboard",[387,403,404,407,408,183],{},[156,405,406],{},"table",": The name of the table to read from. It defaults to ",[156,409,410],{},"storage",[387,412,413,416,417,183],{},[156,414,415],{},"boostCache",": Whether to enable cached queries: See ",[396,418,421],{"href":419,"rel":420},"https:\u002F\u002Fplanetscale.com\u002Fdocs\u002Fconcepts\u002Fquery-caching-with-planetscale-boost#using-cached-queries-in-your-application",[400],"docs",[423,424,425],"style",{},"html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}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 .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}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}",{"title":197,"searchDepth":211,"depth":211,"links":427},[428],{"id":145,"depth":211,"text":146},"Store data in MySQL database via PlanetScale.","md",{"icon":111},{"icon":111},{"title":108,"description":429},"g7LYW8ME-XNzdLwnWVtYrRT_7lA4avwUfdVRaJtKlig",[436,437],{"title":103,"path":104,"stem":105,"description":197,"icon":106,"children":-1},{"title":113,"path":114,"stem":115,"description":438,"icon":116,"children":-1},"Store data in a Redis.",1781217588720]