[{"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","/guide","1.guide/1.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","/guide/utils","1.guide/2.utils","et:tools-2",{"title":17,"path":18,"stem":19,"icon":20},"HTTP Server","/guide/http-server","1.guide/3.http-server","ic:baseline-http",{"title":22,"path":23,"stem":24,"icon":25},"Custom Driver","/guide/custom-driver","1.guide/4.custom-driver","carbon:area-custom",{"title":27,"path":28,"stem":29,"children":30,"icon":32},"Drivers","/drivers","2.drivers/0.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","/drivers/azure","2.drivers/azure","mdi:microsoft-azure",{"title":39,"path":40,"stem":41,"icon":42},"Browser","/drivers/browser","2.drivers/browser","ph:browser-thin",{"title":44,"path":45,"stem":46,"icon":47},"Capacitor Preferences","/drivers/capacitor-preferences","2.drivers/capacitor-preferences","nonicons:capacitor-16",{"title":49,"path":50,"stem":51,"icon":52},"Cloudflare","/drivers/cloudflare","2.drivers/cloudflare","devicon-plain:cloudflareworkers",{"title":54,"path":55,"stem":56,"icon":57},"SQL Database","/drivers/database","2.drivers/database","ph:database",{"title":59,"path":60,"stem":61,"icon":62},"Deno KV","/drivers/deno","2.drivers/deno","simple-icons:deno",{"title":64,"path":65,"stem":66,"icon":67},"Filesystem (Node.js)","/drivers/fs","2.drivers/fs","ph:file-light",{"title":69,"path":70,"stem":71,"icon":72},"GitHub","/drivers/github","2.drivers/github","mdi:github",{"title":74,"path":75,"stem":76,"icon":20},"HTTP","/drivers/http","2.drivers/http",{"title":78,"path":79,"stem":80,"icon":81},"LRU Cache","/drivers/lru-cache","2.drivers/lru-cache","material-symbols:cached-rounded",{"title":83,"path":84,"stem":85,"icon":86},"Memory","/drivers/memory","2.drivers/memory","bi:memory",{"title":88,"path":89,"stem":90,"icon":91},"MongoDB","/drivers/mongodb","2.drivers/mongodb","teenyicons:mongodb-outline",{"title":93,"path":94,"stem":95,"icon":96},"Netlify Blobs","/drivers/netlify","2.drivers/netlify","teenyicons:netlify-solid",{"title":98,"path":99,"stem":100,"icon":101},"Null","/drivers/null","2.drivers/null","bi:trash3-fill",{"title":103,"path":104,"stem":105,"icon":106},"Overlay","/drivers/overlay","2.drivers/overlay","carbon:overlay",{"title":108,"path":109,"stem":110,"icon":111},"PlanetScale","/drivers/planetscale","2.drivers/planetscale","simple-icons:planetscale",{"title":113,"path":114,"stem":115,"icon":116},"Redis","/drivers/redis","2.drivers/redis","simple-icons:redis",{"title":118,"path":119,"stem":120,"icon":121},"S3","/drivers/s3","2.drivers/s3","simple-icons:amazons3",{"title":123,"path":124,"stem":125,"icon":126},"UploadThing","/drivers/uploadthing","2.drivers/uploadthing","qlementine-icons:cloud-16",{"title":128,"path":129,"stem":130,"icon":131},"Upstash","/drivers/upstash","2.drivers/upstash","simple-icons:upstash",{"title":133,"path":134,"stem":135,"icon":136},"Vercel","/drivers/vercel","2.drivers/vercel","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/2.drivers/planetscale.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://planetscale.com/",[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/database"," 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/database\": \"^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/database\"",[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/drivers/planetscale\";\n\nconst storage = createStorage({\n  driver: planetscaleDriver({\n    // This should certainly not be inlined in your code but loaded via runtime config\n    // or environment variables depending on your framework/project.\n    url: \"mysql://xxxxxxxxx:************@xxxxxxxxxx.us-east-3.psdb.cloud/my-database?sslaccept=strict\",\n    // 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/drivers/planetscale\"",[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","    // 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},"    // or environment variables depending on your framework/project.\n",[201,349,351,354,357],{"class":203,"line":350},8,[201,352,353],{"class":207},"    url: ",[201,355,356],{"class":230},"\"mysql://xxxxxxxxx:************@xxxxxxxxxx.us-east-3.psdb.cloud/my-database?sslaccept=strict\"",[201,358,359],{"class":207},",\n",[201,361,363],{"class":203,"line":362},9,[201,364,365],{"class":340},"    // 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://planetscale.com/docs/tutorials/connect-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://planetscale.com/docs/concepts/query-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.",1783786395850]