[{"data":1,"prerenderedAt":1831},["ShallowReactive",2],{"navigation_docs":3,"-docs-guide-databases-and-storage-databases":478,"-docs-guide-databases-and-storage-databases-surround":1826},[4,352,446],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Docs",false,"\u002Fdocs\u002Fcore","docs\u002F1.core",[10,35,141,174,195,212,242,318],{"title":11,"icon":6,"path":12,"stem":13,"children":14,"page":6},"Getting Started","\u002Fdocs\u002Fcore\u002Fgetting-started","docs\u002F1.core\u002F1.getting-started",[15,19,23,27,31],{"title":16,"path":17,"stem":18},"Introduction","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fintroduction","docs\u002F1.core\u002F1.getting-started\u002F1.introduction",{"title":20,"path":21,"stem":22},"Quick Start","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fquick-start","docs\u002F1.core\u002F1.getting-started\u002F2.quick-start",{"title":24,"path":25,"stem":26},"Add to an Existing Site","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fexisting-site","docs\u002F1.core\u002F1.getting-started\u002F3.existing-site",{"title":28,"path":29,"stem":30},"Configuration","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fconfiguration","docs\u002F1.core\u002F1.getting-started\u002F4.configuration",{"title":32,"path":33,"stem":34},"How Tenon works","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fhow-tenon-works","docs\u002F1.core\u002F1.getting-started\u002F5.how-tenon-works",{"title":36,"icon":6,"path":37,"stem":38,"children":39,"page":6},"Content Modeling","\u002Fdocs\u002Fcore\u002Fcontent-modeling","docs\u002F1.core\u002F2.content-modeling",[40,44,111,115,119],{"title":41,"path":42,"stem":43},"Collections and Globals","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fcollections-and-globals","docs\u002F1.core\u002F2.content-modeling\u002F1.collections-and-globals",{"title":45,"icon":6,"path":46,"stem":47,"children":48},"Fields","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002Findex",[49,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107],{"title":50,"path":46,"stem":47},"Overview",{"title":52,"path":53,"stem":54},"Array","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Farray","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F01.array",{"title":56,"path":57,"stem":58},"Blocks","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fblocks","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F02.blocks",{"title":60,"path":61,"stem":62},"Boolean","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fboolean","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F03.boolean",{"title":64,"path":65,"stem":66},"Date","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fdate","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F04.date",{"title":68,"path":69,"stem":70},"File","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ffile","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F05.file",{"title":72,"path":73,"stem":74},"Group","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fgroup","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F06.group",{"title":76,"path":77,"stem":78},"Image","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fimage","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F07.image",{"title":80,"path":81,"stem":82},"Link","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Flink","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F08.link",{"title":84,"path":85,"stem":86},"Number","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fnumber","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F09.number",{"title":88,"path":89,"stem":90},"Relation","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frelation","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F10.relation",{"title":92,"path":93,"stem":94},"Rich text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frich-text","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F11.rich-text",{"title":96,"path":97,"stem":98},"Select","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fselect","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F12.select",{"title":100,"path":101,"stem":102},"Size","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fsize","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F13.size",{"title":104,"path":105,"stem":106},"Slug","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fslug","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F14.slug",{"title":108,"path":109,"stem":110},"Text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ftext","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F15.text",{"title":112,"path":113,"stem":114},"Relations","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Frelations","docs\u002F1.core\u002F2.content-modeling\u002F3.relations",{"title":116,"path":117,"stem":118},"Media","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fmedia","docs\u002F1.core\u002F2.content-modeling\u002F4.media",{"title":120,"icon":6,"path":121,"stem":122,"children":123},"Presets","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002Findex",[124,125,129,133,137],{"title":50,"path":121,"stem":122},{"title":126,"path":127,"stem":128},"Menu","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fmenu","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F1.menu",{"title":130,"path":131,"stem":132},"Pages","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fpages","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F2.pages",{"title":134,"path":135,"stem":136},"Settings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fsettings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F3.settings",{"title":138,"path":139,"stem":140},"Strings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fstrings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F4.strings",{"title":142,"icon":6,"path":143,"stem":144,"children":145,"page":6},"Working with Content","\u002Fdocs\u002Fcore\u002Fworking-with-content","docs\u002F1.core\u002F3.working-with-content",[146,150,154,158,162,166,170],{"title":147,"path":148,"stem":149},"Reading","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Freading","docs\u002F1.core\u002F3.working-with-content\u002F1.reading",{"title":151,"path":152,"stem":153},"Writing and Drafts","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fwriting","docs\u002F1.core\u002F3.working-with-content\u002F2.writing",{"title":155,"path":156,"stem":157},"Scheduled publishing","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fscheduled-publishing","docs\u002F1.core\u002F3.working-with-content\u002F3.scheduled-publishing",{"title":159,"path":160,"stem":161},"HTTP API and Client","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhttp-api-and-client","docs\u002F1.core\u002F3.working-with-content\u002F4.http-api-and-client",{"title":163,"path":164,"stem":165},"Headless","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fheadless","docs\u002F1.core\u002F3.working-with-content\u002F5.headless",{"title":167,"path":168,"stem":169},"Localization","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Flocalization","docs\u002F1.core\u002F3.working-with-content\u002F6.localization",{"title":171,"path":172,"stem":173},"Hooks","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhooks","docs\u002F1.core\u002F3.working-with-content\u002F7.hooks",{"title":175,"icon":6,"path":176,"stem":177,"children":178,"page":6},"Building Your Site","\u002Fdocs\u002Fcore\u002Fbuilding-your-site","docs\u002F1.core\u002F4.building-your-site",[179,183,187,191],{"title":180,"path":181,"stem":182},"Pages and SEO","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fpages-and-seo","docs\u002F1.core\u002F4.building-your-site\u002F1.pages-and-seo",{"title":184,"path":185,"stem":186},"Components","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fcomponents","docs\u002F1.core\u002F4.building-your-site\u002F2.components",{"title":188,"path":189,"stem":190},"Menus","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fmenus","docs\u002F1.core\u002F4.building-your-site\u002F3.menus",{"title":192,"path":193,"stem":194},"Live Preview","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Flive-preview","docs\u002F1.core\u002F4.building-your-site\u002F4.live-preview",{"title":196,"icon":6,"path":197,"stem":198,"children":199,"page":6},"Users and Access","\u002Fdocs\u002Fcore\u002Fusers-and-access","docs\u002F1.core\u002F5.users-and-access",[200,204,208],{"title":201,"path":202,"stem":203},"Authentication","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fauthentication","docs\u002F1.core\u002F5.users-and-access\u002F1.authentication",{"title":205,"path":206,"stem":207},"Access Control","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Faccess-control","docs\u002F1.core\u002F5.users-and-access\u002F2.access-control",{"title":209,"path":210,"stem":211},"API Keys","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fapi-keys","docs\u002F1.core\u002F5.users-and-access\u002F3.api-keys",{"title":213,"icon":6,"path":214,"stem":215,"children":216},"Customization","\u002Fdocs\u002Fcore\u002Fcustomization","docs\u002F1.core\u002F6.customization\u002Findex",[217,218,222,226,230,234,238],{"title":50,"path":214,"stem":215},{"title":219,"path":220,"stem":221},"Admin","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fadmin","docs\u002F1.core\u002F6.customization\u002F1.admin",{"title":223,"path":224,"stem":225},"Custom Fields","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-fields","docs\u002F1.core\u002F6.customization\u002F2.custom-fields",{"title":227,"path":228,"stem":229},"Custom Pages and Actions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-pages-and-actions","docs\u002F1.core\u002F6.customization\u002F3.custom-pages-and-actions",{"title":231,"path":232,"stem":233},"Styles and UI Libraries","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fstyles-and-ui-libraries","docs\u002F1.core\u002F6.customization\u002F4.styles-and-ui-libraries",{"title":235,"path":236,"stem":237},"Rich Text Extensions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Frich-text-extensions","docs\u002F1.core\u002F6.customization\u002F5.rich-text-extensions",{"title":239,"path":240,"stem":241},"Plugins","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fplugins","docs\u002F1.core\u002F6.customization\u002F6.plugins",{"title":243,"icon":6,"path":244,"stem":245,"children":246},"Operations","\u002Fdocs\u002Fcore\u002Foperations","docs\u002F1.core\u002F7.operations\u002Findex",[247,248,266,288,306,310,314],{"title":50,"path":244,"stem":245},{"title":249,"icon":6,"path":250,"stem":251,"children":252},"Email","\u002Fdocs\u002Fcore\u002Foperations\u002Femail","docs\u002F1.core\u002F7.operations\u002F1.email\u002Findex",[253,254,258,262],{"title":50,"path":250,"stem":251},{"title":255,"path":256,"stem":257},"SMTP","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fsmtp","docs\u002F1.core\u002F7.operations\u002F1.email\u002F1.smtp",{"title":259,"path":260,"stem":261},"Cloudflare","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcloudflare","docs\u002F1.core\u002F7.operations\u002F1.email\u002F2.cloudflare",{"title":263,"path":264,"stem":265},"Custom adapter","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcustom-adapter","docs\u002F1.core\u002F7.operations\u002F1.email\u002F3.custom-adapter",{"title":267,"icon":6,"path":268,"stem":269,"children":270},"Jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002Findex",[271,272,276,280,284],{"title":50,"path":268,"stem":269},{"title":273,"path":274,"stem":275},"Queue jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fqueue-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F1.queue-jobs",{"title":277,"path":278,"stem":279},"Recurring jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Frecurring-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F2.recurring-jobs",{"title":281,"path":282,"stem":283},"The clock","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fclock","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F3.clock",{"title":285,"path":286,"stem":287},"Manage jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fmanage-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F4.manage-jobs",{"title":289,"icon":6,"path":290,"stem":291,"children":292},"Webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002Findex",[293,294,298,302],{"title":50,"path":290,"stem":291},{"title":295,"path":296,"stem":297},"Send webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Fsend-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F1.send-webhooks",{"title":299,"path":300,"stem":301},"Receive webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Freceive-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F2.receive-webhooks",{"title":303,"path":304,"stem":305},"Rebuild on publish","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Frebuild-on-publish","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F3.rebuild-on-publish",{"title":307,"path":308,"stem":309},"Backup and Restore","\u002Fdocs\u002Fcore\u002Foperations\u002Fbackup-and-restore","docs\u002F1.core\u002F7.operations\u002F4.backup-and-restore",{"title":311,"path":312,"stem":313},"Lifecycle Hooks","\u002Fdocs\u002Fcore\u002Foperations\u002Flifecycle-hooks","docs\u002F1.core\u002F7.operations\u002F5.lifecycle-hooks",{"title":315,"path":316,"stem":317},"Upgrades and Schema Changes","\u002Fdocs\u002Fcore\u002Foperations\u002Fupgrades-and-schema-changes","docs\u002F1.core\u002F7.operations\u002F6.upgrades-and-schema-changes",{"title":319,"icon":6,"path":320,"stem":321,"children":322,"page":6},"Reference","\u002Fdocs\u002Fcore\u002Freference","docs\u002F1.core\u002F8.reference",[323,326,344,348],{"title":28,"path":324,"stem":325},"\u002Fdocs\u002Fcore\u002Freference\u002Fconfiguration","docs\u002F1.core\u002F8.reference\u002F1.configuration",{"title":327,"icon":6,"path":328,"stem":329,"children":330},"API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi","docs\u002F1.core\u002F8.reference\u002F2.api\u002Findex",[331,332,336,340],{"title":50,"path":328,"stem":329},{"title":333,"path":334,"stem":335},"Local API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Flocal-api","docs\u002F1.core\u002F8.reference\u002F2.api\u002F1.local-api",{"title":337,"path":338,"stem":339},"Client","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fclient","docs\u002F1.core\u002F8.reference\u002F2.api\u002F2.client",{"title":341,"path":342,"stem":343},"HTTP routes","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fhttp-routes","docs\u002F1.core\u002F8.reference\u002F2.api\u002F3.http-routes",{"title":345,"path":346,"stem":347},"Errors and types","\u002Fdocs\u002Fcore\u002Freference\u002Ferrors-and-types","docs\u002F1.core\u002F8.reference\u002F3.errors-and-types",{"title":349,"path":350,"stem":351},"Package exports","\u002Fdocs\u002Fcore\u002Freference\u002Fpackage-exports","docs\u002F1.core\u002F8.reference\u002F4.package-exports",{"title":353,"icon":6,"path":354,"stem":355,"children":356,"page":6},"Guide","\u002Fdocs\u002Fguide","docs\u002F2.guide",[357,383,400,417],{"title":358,"icon":6,"path":359,"stem":360,"children":361},"Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks","docs\u002F2.guide\u002F1.frameworks\u002Findex",[362,363,367,371,375,379],{"title":50,"path":359,"stem":360},{"title":364,"path":365,"stem":366},"Astro","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fastro","docs\u002F2.guide\u002F1.frameworks\u002F1.astro",{"title":368,"path":369,"stem":370},"Nuxt","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fnuxt","docs\u002F2.guide\u002F1.frameworks\u002F2.nuxt",{"title":372,"path":373,"stem":374},"TanStack Start","\u002Fdocs\u002Fguide\u002Fframeworks\u002Ftanstack-start","docs\u002F2.guide\u002F1.frameworks\u002F3.tanstack-start",{"title":376,"path":377,"stem":378},"Standalone","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fstandalone","docs\u002F2.guide\u002F1.frameworks\u002F4.standalone",{"title":380,"path":381,"stem":382},"Other Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fother-frameworks","docs\u002F2.guide\u002F1.frameworks\u002F5.other-frameworks",{"title":384,"icon":6,"path":385,"stem":386,"children":387},"Deployment","\u002Fdocs\u002Fguide\u002Fdeployment","docs\u002F2.guide\u002F2.deployment\u002Findex",[388,389,393,397],{"title":50,"path":385,"stem":386},{"title":390,"path":391,"stem":392},"Node","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fnode","docs\u002F2.guide\u002F2.deployment\u002F1.node",{"title":394,"path":395,"stem":396},"Vercel","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fvercel","docs\u002F2.guide\u002F2.deployment\u002F2.vercel",{"title":259,"path":398,"stem":399},"\u002Fdocs\u002Fguide\u002Fdeployment\u002Fcloudflare","docs\u002F2.guide\u002F2.deployment\u002F3.cloudflare",{"title":401,"icon":6,"path":402,"stem":403,"children":404,"page":6},"Databases and Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage","docs\u002F2.guide\u002F3.databases-and-storage",[405,409,413],{"title":406,"path":407,"stem":408},"Databases","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fdatabases","docs\u002F2.guide\u002F3.databases-and-storage\u002F1.databases",{"title":410,"path":411,"stem":412},"Media Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fmedia-storage","docs\u002F2.guide\u002F3.databases-and-storage\u002F2.media-storage",{"title":414,"path":415,"stem":416},"Image Providers","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fimage-providers","docs\u002F2.guide\u002F3.databases-and-storage\u002F3.image-providers",{"title":418,"icon":6,"path":419,"stem":420,"children":421,"page":6},"Recipes","\u002Fdocs\u002Fguide\u002Frecipes","docs\u002F2.guide\u002F4.recipes",[422,426,430,434,438,442],{"title":423,"path":424,"stem":425},"Seed Content","\u002Fdocs\u002Fguide\u002Frecipes\u002Fseed-content","docs\u002F2.guide\u002F4.recipes\u002F1.seed-content",{"title":427,"path":428,"stem":429},"Tracking and Consent","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftracking-and-consent","docs\u002F2.guide\u002F4.recipes\u002F2.tracking-and-consent",{"title":431,"path":432,"stem":433},"Build a Custom Field","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-custom-field","docs\u002F2.guide\u002F4.recipes\u002F3.build-a-custom-field",{"title":435,"path":436,"stem":437},"Write a Plugin","\u002Fdocs\u002Fguide\u002Frecipes\u002Fwrite-a-plugin","docs\u002F2.guide\u002F4.recipes\u002F4.write-a-plugin",{"title":439,"path":440,"stem":441},"Build a Headless Site with Next.js","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-headless-site-with-nextjs","docs\u002F2.guide\u002F4.recipes\u002F5.build-a-headless-site-with-nextjs",{"title":443,"path":444,"stem":445},"Troubleshooting","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftroubleshooting","docs\u002F2.guide\u002F4.recipes\u002F6.troubleshooting",{"title":447,"icon":6,"path":448,"stem":449,"children":450,"page":6},"CLI","\u002Fdocs\u002Fcli","docs\u002F3.cli",[451,454,458,462,466,470,474],{"title":50,"path":452,"stem":453},"\u002Fdocs\u002Fcli\u002Foverview","docs\u002F3.cli\u002F1.overview",{"title":455,"path":456,"stem":457},"create-tenoncms","\u002Fdocs\u002Fcli\u002Fcreate-tenoncms","docs\u002F3.cli\u002F2.create-tenoncms",{"title":459,"path":460,"stem":461},"tenon backup","\u002Fdocs\u002Fcli\u002Fbackup","docs\u002F3.cli\u002F3.backup",{"title":463,"path":464,"stem":465},"tenon users","\u002Fdocs\u002Fcli\u002Fusers","docs\u002F3.cli\u002F4.users",{"title":467,"path":468,"stem":469},"tenon media","\u002Fdocs\u002Fcli\u002Fmedia","docs\u002F3.cli\u002F5.media",{"title":471,"path":472,"stem":473},"tenon upgrade","\u002Fdocs\u002Fcli\u002Fupgrade","docs\u002F3.cli\u002F6.upgrade",{"title":475,"path":476,"stem":477},"tenon login","\u002Fdocs\u002Fcli\u002Flogin","docs\u002F3.cli\u002F7.login",{"id":479,"title":406,"body":480,"description":1820,"extension":1821,"links":1822,"meta":1823,"navigation":569,"path":407,"seo":1824,"stem":408,"__hash__":1825},"docs\u002Fdocs\u002F2.guide\u002F3.databases-and-storage\u002F1.databases.md",{"type":481,"value":482,"toc":1804},"minimark",[483,496,633,640,653,658,661,791,799,802,805,808,813,823,910,924,935,939,947,1013,1140,1160,1174,1199,1203,1206,1215,1270,1350,1387,1419,1422,1425,1480,1595,1605,1608,1624,1628,1639,1643,1662,1669,1673,1679,1710,1724,1731,1735,1738,1762,1769,1773,1800],[484,485,486,487,491,492,495],"p",{},"Tenon stores content, users and jobs in one database. You pick it with the ",[488,489,490],"code",{},"database"," option in ",[488,493,494],{},"tenon.config.ts",". The smallest setup uses Node's built-in SQLite and needs no package:",[497,498,503],"pre",{"className":499,"code":500,"filename":494,"language":501,"meta":502,"style":502},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineCms } from \"tenoncms\";\nimport { sqlite } from \"tenoncms\u002Fsqlite\";\n\nexport default defineCms({\n  \u002F\u002F ...\n  database: sqlite(\".\u002Fcms.db\"),\n});\n","ts","",[488,504,505,541,564,571,589,596,623],{"__ignoreMap":502},[506,507,510,514,518,522,525,528,531,535,538],"span",{"class":508,"line":509},"line",1,[506,511,513],{"class":512},"s7zQu","import",[506,515,517],{"class":516},"sMK4o"," {",[506,519,521],{"class":520},"sTEyZ"," defineCms",[506,523,524],{"class":516}," }",[506,526,527],{"class":512}," from",[506,529,530],{"class":516}," \"",[506,532,534],{"class":533},"sfazB","tenoncms",[506,536,537],{"class":516},"\"",[506,539,540],{"class":516},";\n",[506,542,544,546,548,551,553,555,557,560,562],{"class":508,"line":543},2,[506,545,513],{"class":512},[506,547,517],{"class":516},[506,549,550],{"class":520}," sqlite",[506,552,524],{"class":516},[506,554,527],{"class":512},[506,556,530],{"class":516},[506,558,559],{"class":533},"tenoncms\u002Fsqlite",[506,561,537],{"class":516},[506,563,540],{"class":516},[506,565,567],{"class":508,"line":566},3,[506,568,570],{"emptyLinePlaceholder":569},true,"\n",[506,572,574,577,580,583,586],{"class":508,"line":573},4,[506,575,576],{"class":512},"export",[506,578,579],{"class":512}," default",[506,581,521],{"class":582},"s2Zo4",[506,584,585],{"class":520},"(",[506,587,588],{"class":516},"{\n",[506,590,592],{"class":508,"line":591},5,[506,593,595],{"class":594},"sHwdD","  \u002F\u002F ...\n",[506,597,599,603,606,608,610,612,615,617,620],{"class":508,"line":598},6,[506,600,602],{"class":601},"swJcz","  database",[506,604,605],{"class":516},":",[506,607,550],{"class":582},[506,609,585],{"class":520},[506,611,537],{"class":516},[506,613,614],{"class":533},".\u002Fcms.db",[506,616,537],{"class":516},[506,618,619],{"class":520},")",[506,621,622],{"class":516},",\n",[506,624,626,629,631],{"class":508,"line":625},7,[506,627,628],{"class":516},"}",[506,630,619],{"class":520},[506,632,540],{"class":516},[484,634,635,636,639],{},"Tenon creates ",[488,637,638],{},"cms.db"," and its tables on the first request.",[484,641,642,643,646,647,652],{},"The examples on this page read values from ",[488,644,645],{},"process.env",". Astro and Nuxt read them in their own way. See ",[648,649,651],"a",{"href":650},"\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fconfiguration#environment-variables","Environment variables",".",[654,655,657],"h2",{"id":656},"pick-a-database","Pick a database",[484,659,660],{},"Each database has its own import and driver, so you install only the one you use:",[662,663,664,684],"table",{},[665,666,667],"thead",{},[668,669,670,674,678,681],"tr",{},[671,672,673],"th",{},"Database",[671,675,676],{},[488,677,490],{},[671,679,680],{},"Install",[671,682,683],{},"Use it for",[685,686,687,707,728,749,770],"tbody",{},[668,688,689,693,701,704],{},[690,691,692],"td",{},"SQLite",[690,694,695,698,699],{},[488,696,697],{},"sqlite(path)"," from ",[488,700,559],{},[690,702,703],{},"Nothing (Node 22.16+)",[690,705,706],{},"A Node server with a disk that keeps its files",[668,708,709,712,720,725],{},[690,710,711],{},"SQLite and Turso",[690,713,714,698,717],{},[488,715,716],{},"libsql(url)",[488,718,719],{},"tenoncms\u002Flibsql",[690,721,722],{},[488,723,724],{},"@libsql\u002Fclient",[690,726,727],{},"A local file, or Turso on a serverless host such as Vercel",[668,729,730,733,741,746],{},[690,731,732],{},"Postgres",[690,734,735,698,738],{},[488,736,737],{},"postgres(url)",[488,739,740],{},"tenoncms\u002Fpostgres",[690,742,743],{},[488,744,745],{},"pg",[690,747,748],{},"A Postgres server, such as Neon, on Node or Vercel",[668,750,751,754,762,767],{},[690,752,753],{},"PGlite",[690,755,756,698,759],{},[488,757,758],{},"pglite(new PGlite(dir))",[488,760,761],{},"tenoncms\u002Fpglite",[690,763,764],{},[488,765,766],{},"@electric-sql\u002Fpglite",[690,768,769],{},"Postgres in local development and tests",[668,771,772,775,783,786],{},[690,773,774],{},"Durable Object",[690,776,777,698,780],{},[488,778,779],{},"durableObject()",[488,781,782],{},"tenoncms\u002Fcloudflare",[690,784,785],{},"Nothing",[690,787,788,789],{},"Cloudflare Workers. See ",[648,790,259],{"href":398},[484,792,793,796,797,652],{},[488,794,795],{},"npm create tenoncms"," asks for the database and offers only the ones that work where the site runs. See ",[648,798,455],{"href":456},[484,800,801],{},"A missing URL or path stops the server at startup, with one error that lists every problem of the config. A build that loads the config, for example to prerender pages, needs the values too.",[654,803,711],{"id":804},"sqlite-and-turso",[484,806,807],{},"SQLite keeps the whole database in one file. It needs a disk that keeps its files between deploys, so it fits a Node server. On a serverless host, use Turso, which runs libSQL as a service.",[809,810,812],"h3",{"id":811},"nodes-built-in-sqlite","Node's built-in SQLite",[484,814,815,818,819,822],{},[488,816,817],{},"sqlite()"," uses ",[488,820,821],{},"node:sqlite",", which ships with Node 22.16 and later:",[497,824,826],{"className":499,"code":825,"filename":494,"language":501,"meta":502,"style":502},"import { sqlite } from \"tenoncms\u002Fsqlite\";\n\nexport default defineCms({\n  \u002F\u002F ...\n  database: sqlite(process.env.DATABASE_PATH ?? \".\u002Fcms.db\"),\n});\n",[488,827,828,848,852,864,868,902],{"__ignoreMap":502},[506,829,830,832,834,836,838,840,842,844,846],{"class":508,"line":509},[506,831,513],{"class":512},[506,833,517],{"class":516},[506,835,550],{"class":520},[506,837,524],{"class":516},[506,839,527],{"class":512},[506,841,530],{"class":516},[506,843,559],{"class":533},[506,845,537],{"class":516},[506,847,540],{"class":516},[506,849,850],{"class":508,"line":543},[506,851,570],{"emptyLinePlaceholder":569},[506,853,854,856,858,860,862],{"class":508,"line":566},[506,855,576],{"class":512},[506,857,579],{"class":512},[506,859,521],{"class":582},[506,861,585],{"class":520},[506,863,588],{"class":516},[506,865,866],{"class":508,"line":573},[506,867,595],{"class":594},[506,869,870,872,874,876,879,881,884,886,889,892,894,896,898,900],{"class":508,"line":591},[506,871,602],{"class":601},[506,873,605],{"class":516},[506,875,550],{"class":582},[506,877,878],{"class":520},"(process",[506,880,652],{"class":516},[506,882,883],{"class":520},"env",[506,885,652],{"class":516},[506,887,888],{"class":520},"DATABASE_PATH ",[506,890,891],{"class":516},"??",[506,893,530],{"class":516},[506,895,614],{"class":533},[506,897,537],{"class":516},[506,899,619],{"class":520},[506,901,622],{"class":516},[506,903,904,906,908],{"class":508,"line":598},[506,905,628],{"class":516},[506,907,619],{"class":520},[506,909,540],{"class":516},[911,912,913],"field-group",{},[914,915,919,920,923],"field",{"name":916,"type":917,":required":918},"path","string","true","The file, or ",[488,921,922],{},":memory:"," for a database that lives only as long as the process. A relative path starts in the working directory. Use an absolute path in production.",[484,925,926,927,930,931,934],{},"On an older Node version, use ",[488,928,929],{},"libsql()"," with a ",[488,932,933],{},"file:"," URL.",[809,936,938],{"id":937},"libsql","libSQL",[484,940,941,943,944,946],{},[488,942,929],{}," takes a URL, or the options of ",[488,945,724],{},". Install the driver:",[948,949,951,970,985,999],"code-group",{"sync":950},"pm",[497,952,957],{"className":953,"code":954,"filename":955,"language":956,"meta":502,"style":502},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npm install @libsql\u002Fclient\n","npm","bash",[488,958,959],{"__ignoreMap":502},[506,960,961,964,967],{"class":508,"line":509},[506,962,955],{"class":963},"sBMFI",[506,965,966],{"class":533}," install",[506,968,969],{"class":533}," @libsql\u002Fclient\n",[497,971,974],{"className":953,"code":972,"filename":973,"language":956,"meta":502,"style":502},"pnpm add @libsql\u002Fclient\n","pnpm",[488,975,976],{"__ignoreMap":502},[506,977,978,980,983],{"class":508,"line":509},[506,979,973],{"class":963},[506,981,982],{"class":533}," add",[506,984,969],{"class":533},[497,986,989],{"className":953,"code":987,"filename":988,"language":956,"meta":502,"style":502},"yarn add @libsql\u002Fclient\n","yarn",[488,990,991],{"__ignoreMap":502},[506,992,993,995,997],{"class":508,"line":509},[506,994,988],{"class":963},[506,996,982],{"class":533},[506,998,969],{"class":533},[497,1000,1003],{"className":953,"code":1001,"filename":1002,"language":956,"meta":502,"style":502},"bun add @libsql\u002Fclient\n","bun",[488,1004,1005],{"__ignoreMap":502},[506,1006,1007,1009,1011],{"class":508,"line":509},[506,1008,1002],{"class":963},[506,1010,982],{"class":533},[506,1012,969],{"class":533},[497,1014,1016],{"className":499,"code":1015,"filename":494,"language":501,"meta":502,"style":502},"import { libsql } from \"tenoncms\u002Flibsql\";\n\nexport default defineCms({\n  \u002F\u002F ...\n  database: libsql({\n    url: process.env.DATABASE_URL ?? \"file:.\u002Fcms.db\",\n    authToken: process.env.DATABASE_AUTH_TOKEN,\n  }),\n});\n",[488,1017,1018,1039,1043,1055,1059,1071,1101,1121,1131],{"__ignoreMap":502},[506,1019,1020,1022,1024,1027,1029,1031,1033,1035,1037],{"class":508,"line":509},[506,1021,513],{"class":512},[506,1023,517],{"class":516},[506,1025,1026],{"class":520}," libsql",[506,1028,524],{"class":516},[506,1030,527],{"class":512},[506,1032,530],{"class":516},[506,1034,719],{"class":533},[506,1036,537],{"class":516},[506,1038,540],{"class":516},[506,1040,1041],{"class":508,"line":543},[506,1042,570],{"emptyLinePlaceholder":569},[506,1044,1045,1047,1049,1051,1053],{"class":508,"line":566},[506,1046,576],{"class":512},[506,1048,579],{"class":512},[506,1050,521],{"class":582},[506,1052,585],{"class":520},[506,1054,588],{"class":516},[506,1056,1057],{"class":508,"line":573},[506,1058,595],{"class":594},[506,1060,1061,1063,1065,1067,1069],{"class":508,"line":591},[506,1062,602],{"class":601},[506,1064,605],{"class":516},[506,1066,1026],{"class":582},[506,1068,585],{"class":520},[506,1070,588],{"class":516},[506,1072,1073,1076,1078,1081,1083,1085,1087,1090,1092,1094,1097,1099],{"class":508,"line":598},[506,1074,1075],{"class":601},"    url",[506,1077,605],{"class":516},[506,1079,1080],{"class":520}," process",[506,1082,652],{"class":516},[506,1084,883],{"class":520},[506,1086,652],{"class":516},[506,1088,1089],{"class":520},"DATABASE_URL ",[506,1091,891],{"class":516},[506,1093,530],{"class":516},[506,1095,1096],{"class":533},"file:.\u002Fcms.db",[506,1098,537],{"class":516},[506,1100,622],{"class":516},[506,1102,1103,1106,1108,1110,1112,1114,1116,1119],{"class":508,"line":625},[506,1104,1105],{"class":601},"    authToken",[506,1107,605],{"class":516},[506,1109,1080],{"class":520},[506,1111,652],{"class":516},[506,1113,883],{"class":520},[506,1115,652],{"class":516},[506,1117,1118],{"class":520},"DATABASE_AUTH_TOKEN",[506,1120,622],{"class":516},[506,1122,1124,1127,1129],{"class":508,"line":1123},8,[506,1125,1126],{"class":516},"  }",[506,1128,619],{"class":520},[506,1130,622],{"class":516},[506,1132,1134,1136,1138],{"class":508,"line":1133},9,[506,1135,628],{"class":516},[506,1137,619],{"class":520},[506,1139,540],{"class":516},[911,1141,1142,1156],{},[914,1143,1145,1146,1148,1149,1151,1152,1155],{"name":1144,"type":917,":required":918},"url","A file (",[488,1147,1096],{},"), ",[488,1150,922],{},", or a Turso URL (",[488,1153,1154],{},"libsql:\u002F\u002F\u003Cdb>-\u003Corg>.turso.io","). A relative file starts in the working directory.",[914,1157,1159],{"name":1158,"type":917},"authToken","The token of a Turso database. A file needs none.",[484,1161,1162,1164,1165,698,1168,1170,1171,652],{},[488,1163,929],{}," also takes every other option of ",[488,1166,1167],{},"createClient()",[488,1169,724],{},". A string is the same as ",[488,1172,1173],{},"{ url }",[1175,1176,1177,1196],"ul",{},[1178,1179,1180,1181,1184,1185,1188,1189,1192,1193,1195],"li",{},"A ",[488,1182,1183],{},"libsql:",", ",[488,1186,1187],{},"https:"," or ",[488,1190,1191],{},"wss:"," URL uses the web client of ",[488,1194,724],{},". It loads no native binary, so it also runs in serverless functions.",[1178,1197,1198],{},"On Vercel, a function's files do not persist. Use a file in development and Turso in production.",[654,1200,1202],{"id":1201},"postgres-and-pglite","Postgres and PGlite",[809,1204,732],{"id":1205},"postgres",[484,1207,1208,1211,1212,1214],{},[488,1209,1210],{},"postgres()"," connects to a Postgres server through a ",[488,1213,745],{}," pool. Install the driver:",[948,1216,1217,1231,1244,1257],{"sync":950},[497,1218,1220],{"className":953,"code":1219,"filename":955,"language":956,"meta":502,"style":502},"npm install pg\n",[488,1221,1222],{"__ignoreMap":502},[506,1223,1224,1226,1228],{"class":508,"line":509},[506,1225,955],{"class":963},[506,1227,966],{"class":533},[506,1229,1230],{"class":533}," pg\n",[497,1232,1234],{"className":953,"code":1233,"filename":973,"language":956,"meta":502,"style":502},"pnpm add pg\n",[488,1235,1236],{"__ignoreMap":502},[506,1237,1238,1240,1242],{"class":508,"line":509},[506,1239,973],{"class":963},[506,1241,982],{"class":533},[506,1243,1230],{"class":533},[497,1245,1247],{"className":953,"code":1246,"filename":988,"language":956,"meta":502,"style":502},"yarn add pg\n",[488,1248,1249],{"__ignoreMap":502},[506,1250,1251,1253,1255],{"class":508,"line":509},[506,1252,988],{"class":963},[506,1254,982],{"class":533},[506,1256,1230],{"class":533},[497,1258,1260],{"className":953,"code":1259,"filename":1002,"language":956,"meta":502,"style":502},"bun add pg\n",[488,1261,1262],{"__ignoreMap":502},[506,1263,1264,1266,1268],{"class":508,"line":509},[506,1265,1002],{"class":963},[506,1267,982],{"class":533},[506,1269,1230],{"class":533},[497,1271,1273],{"className":499,"code":1272,"filename":494,"language":501,"meta":502,"style":502},"import { postgres } from \"tenoncms\u002Fpostgres\";\n\nexport default defineCms({\n  \u002F\u002F ...\n  database: postgres(process.env.DATABASE_URL!),\n});\n",[488,1274,1275,1296,1300,1312,1316,1342],{"__ignoreMap":502},[506,1276,1277,1279,1281,1284,1286,1288,1290,1292,1294],{"class":508,"line":509},[506,1278,513],{"class":512},[506,1280,517],{"class":516},[506,1282,1283],{"class":520}," postgres",[506,1285,524],{"class":516},[506,1287,527],{"class":512},[506,1289,530],{"class":516},[506,1291,740],{"class":533},[506,1293,537],{"class":516},[506,1295,540],{"class":516},[506,1297,1298],{"class":508,"line":543},[506,1299,570],{"emptyLinePlaceholder":569},[506,1301,1302,1304,1306,1308,1310],{"class":508,"line":566},[506,1303,576],{"class":512},[506,1305,579],{"class":512},[506,1307,521],{"class":582},[506,1309,585],{"class":520},[506,1311,588],{"class":516},[506,1313,1314],{"class":508,"line":573},[506,1315,595],{"class":594},[506,1317,1318,1320,1322,1324,1326,1328,1330,1332,1335,1338,1340],{"class":508,"line":591},[506,1319,602],{"class":601},[506,1321,605],{"class":516},[506,1323,1283],{"class":582},[506,1325,878],{"class":520},[506,1327,652],{"class":516},[506,1329,883],{"class":520},[506,1331,652],{"class":516},[506,1333,1334],{"class":520},"DATABASE_URL",[506,1336,1337],{"class":516},"!",[506,1339,619],{"class":520},[506,1341,622],{"class":516},[506,1343,1344,1346,1348],{"class":508,"line":598},[506,1345,628],{"class":516},[506,1347,619],{"class":520},[506,1349,540],{"class":516},[911,1351,1352],{},[914,1353,1356,1357,1360,1361,1363,1364,1184,1367,1184,1370,1184,1373,1184,1375,1378,1379,1382,1383,1386],{"name":1354,"type":1355,":required":918},"config","string | PoolConfig","A connection string, like ",[488,1358,1359],{},"postgres:\u002F\u002Fuser:password@localhost:5432\u002Fcms",". Or the options of a ",[488,1362,745],{}," pool, such as ",[488,1365,1366],{},"host",[488,1368,1369],{},"user",[488,1371,1372],{},"password",[488,1374,490],{},[488,1376,1377],{},"max"," and ",[488,1380,1381],{},"ssl",". A pool config without a connection string can also read the ",[488,1384,1385],{},"PG*"," environment variables.",[1175,1388,1389,1410,1416],{},[1178,1390,1391,1393,1394,1397,1398,1400,1401,698,1404,1407,1408,652],{},[488,1392,1210],{}," also returns ",[488,1395,1396],{},"pool",", the ",[488,1399,745],{}," pool. On Vercel, pass it to ",[488,1402,1403],{},"attachDatabasePool()",[488,1405,1406],{},"@vercel\u002Ffunctions",", so idle connections close before the function is suspended. See ",[648,1409,394],{"href":395},[1178,1411,1412,1413,652],{},"A pooled connection string works, also behind PgBouncer in transaction mode, like Neon's URL with ",[488,1414,1415],{},"-pooler",[1178,1417,1418],{},"Tenon creates its tables in the current schema of the connection.",[809,1420,753],{"id":1421},"pglite",[484,1423,1424],{},"PGlite is Postgres compiled to WebAssembly. It runs in the same process, in memory or in a folder. Use it to develop and test against Postgres without a server:",[948,1426,1427,1441,1454,1467],{"sync":950},[497,1428,1430],{"className":953,"code":1429,"filename":955,"language":956,"meta":502,"style":502},"npm install @electric-sql\u002Fpglite\n",[488,1431,1432],{"__ignoreMap":502},[506,1433,1434,1436,1438],{"class":508,"line":509},[506,1435,955],{"class":963},[506,1437,966],{"class":533},[506,1439,1440],{"class":533}," @electric-sql\u002Fpglite\n",[497,1442,1444],{"className":953,"code":1443,"filename":973,"language":956,"meta":502,"style":502},"pnpm add @electric-sql\u002Fpglite\n",[488,1445,1446],{"__ignoreMap":502},[506,1447,1448,1450,1452],{"class":508,"line":509},[506,1449,973],{"class":963},[506,1451,982],{"class":533},[506,1453,1440],{"class":533},[497,1455,1457],{"className":953,"code":1456,"filename":988,"language":956,"meta":502,"style":502},"yarn add @electric-sql\u002Fpglite\n",[488,1458,1459],{"__ignoreMap":502},[506,1460,1461,1463,1465],{"class":508,"line":509},[506,1462,988],{"class":963},[506,1464,982],{"class":533},[506,1466,1440],{"class":533},[497,1468,1470],{"className":953,"code":1469,"filename":1002,"language":956,"meta":502,"style":502},"bun add @electric-sql\u002Fpglite\n",[488,1471,1472],{"__ignoreMap":502},[506,1473,1474,1476,1478],{"class":508,"line":509},[506,1475,1002],{"class":963},[506,1477,982],{"class":533},[506,1479,1440],{"class":533},[497,1481,1483],{"className":499,"code":1482,"filename":494,"language":501,"meta":502,"style":502},"import { PGlite } from \"@electric-sql\u002Fpglite\";\nimport { pglite } from \"tenoncms\u002Fpglite\";\n\nexport default defineCms({\n  \u002F\u002F ...\n  database: pglite(new PGlite(process.env.DATABASE_DIR ?? \".\u002F.pglite\")),\n});\n",[488,1484,1485,1506,1527,1531,1543,1547,1587],{"__ignoreMap":502},[506,1486,1487,1489,1491,1494,1496,1498,1500,1502,1504],{"class":508,"line":509},[506,1488,513],{"class":512},[506,1490,517],{"class":516},[506,1492,1493],{"class":520}," PGlite",[506,1495,524],{"class":516},[506,1497,527],{"class":512},[506,1499,530],{"class":516},[506,1501,766],{"class":533},[506,1503,537],{"class":516},[506,1505,540],{"class":516},[506,1507,1508,1510,1512,1515,1517,1519,1521,1523,1525],{"class":508,"line":543},[506,1509,513],{"class":512},[506,1511,517],{"class":516},[506,1513,1514],{"class":520}," pglite",[506,1516,524],{"class":516},[506,1518,527],{"class":512},[506,1520,530],{"class":516},[506,1522,761],{"class":533},[506,1524,537],{"class":516},[506,1526,540],{"class":516},[506,1528,1529],{"class":508,"line":566},[506,1530,570],{"emptyLinePlaceholder":569},[506,1532,1533,1535,1537,1539,1541],{"class":508,"line":573},[506,1534,576],{"class":512},[506,1536,579],{"class":512},[506,1538,521],{"class":582},[506,1540,585],{"class":520},[506,1542,588],{"class":516},[506,1544,1545],{"class":508,"line":591},[506,1546,595],{"class":594},[506,1548,1549,1551,1553,1555,1557,1560,1562,1564,1566,1568,1570,1573,1575,1577,1580,1582,1585],{"class":508,"line":598},[506,1550,602],{"class":601},[506,1552,605],{"class":516},[506,1554,1514],{"class":582},[506,1556,585],{"class":520},[506,1558,1559],{"class":516},"new",[506,1561,1493],{"class":582},[506,1563,878],{"class":520},[506,1565,652],{"class":516},[506,1567,883],{"class":520},[506,1569,652],{"class":516},[506,1571,1572],{"class":520},"DATABASE_DIR ",[506,1574,891],{"class":516},[506,1576,530],{"class":516},[506,1578,1579],{"class":533},".\u002F.pglite",[506,1581,537],{"class":516},[506,1583,1584],{"class":520},"))",[506,1586,622],{"class":516},[506,1588,1589,1591,1593],{"class":508,"line":625},[506,1590,628],{"class":516},[506,1592,619],{"class":520},[506,1594,540],{"class":516},[484,1596,1597,1600,1601,1604],{},[488,1598,1599],{},"pglite()"," takes the PGlite instance. ",[488,1602,1603],{},"new PGlite()"," without a folder keeps the data in memory.",[484,1606,1607],{},"Keep the database files out of git:",[497,1609,1612],{"className":953,"code":1610,"filename":1611,"language":956,"meta":502,"style":502},"cms.db*\n.pglite\n",".gitignore",[488,1613,1614,1619],{"__ignoreMap":502},[506,1615,1616],{"class":508,"line":509},[506,1617,1618],{"class":963},"cms.db*\n",[506,1620,1621],{"class":508,"line":543},[506,1622,1623],{"class":963},".pglite\n",[654,1625,1627],{"id":1626},"durable-objects","Durable Objects",[484,1629,1630,1631,698,1634,1636,1637,652],{},"On Cloudflare Workers, the CMS runs inside a Durable Object with its own SQLite storage. ",[488,1632,1633],{},"database: durableObject()",[488,1635,782],{}," needs no package and no URL. The setup has more parts, so it has its own guide: ",[648,1638,259],{"href":398},[654,1640,1642],{"id":1641},"your-own-database-driver","Your own database driver",[484,1644,1645,1647,1648,1651,1652,1658,1659,652],{},[488,1646,490],{}," also takes ",[488,1649,1650],{},"{ dialect }",", a ",[648,1653,1657],{"href":1654,"rel":1655},"https:\u002F\u002Fkysely.dev",[1656],"nofollow","Kysely"," dialect that you build yourself. It runs the SQLite queries, or the Postgres queries when the dialect uses Kysely's ",[488,1660,1661],{},"PostgresAdapter",[484,1663,1664,1665,1668],{},"Its transactions MUST stay open across ",[488,1666,1667],{},"await",", because hooks and nested writes run inside them.",[654,1670,1672],{"id":1671},"migrations","Migrations",[484,1674,1675,1676,1678],{},"Tenon creates and updates its own tables. There is no command to run. On the first query after a start, it runs the migrations of the installed ",[488,1677,534],{}," version, then the tables of better-auth and its plugins.",[662,1680,1681,1690],{},[665,1682,1683],{},[668,1684,1685,1687],{},[671,1686,673],{},[671,1688,1689],{},"How it migrates",[685,1691,1692,1700],{},[668,1693,1694,1697],{},[690,1695,1696],{},"Postgres, PGlite, libSQL",[690,1698,1699],{},"In one transaction. A failed run changes nothing.",[668,1701,1702,1707],{},[690,1703,1704,1706],{},[488,1705,821],{},", Durable Object",[690,1708,1709],{},"Without a transaction.",[1175,1711,1712,1715,1718],{},[1178,1713,1714],{},"Several instances can start at once on a fresh Postgres or libSQL database. They migrate one after the other: Postgres waits for a lock, libSQL for the write lock of the database.",[1178,1716,1717],{},"An instance on a migrated database only reads, so it blocks no one.",[1178,1719,1720,1721,1723],{},"With ",[488,1722,817],{},", start one instance first on a fresh database.",[484,1725,1726,1727,1730],{},"Your fields need no migration. Content lives as JSON, so a change to a collection takes effect on the next start. See ",[648,1728,1729],{"href":316},"Upgrades and schema changes"," for what happens to existing content.",[654,1732,1734],{"id":1733},"switch-to-another-database","Switch to another database",[484,1736,1737],{},"Move the content with a backup. For example, from SQLite to Postgres:",[1739,1740,1741,1747,1756],"ol",{},[1178,1742,1743,1744,652],{},"Back up the site with ",[488,1745,1746],{},"npx tenon backup --content-only",[1178,1748,1749,1750,1752,1753,1755],{},"Point ",[488,1751,490],{}," in ",[488,1754,494],{}," to the new database.",[1178,1757,1758,1759,652],{},"Restore the file with ",[488,1760,1761],{},"npx tenon restore",[484,1763,1764,1765,652],{},"The users do not move. See ",[648,1766,1768],{"href":1767},"\u002Fdocs\u002Fcore\u002Foperations\u002Fbackup-and-restore#move-from-sqlite-to-postgres","Move from SQLite to Postgres",[654,1770,1772],{"id":1771},"related-resources","Related resources",[1175,1774,1775,1783,1789,1794],{},[1178,1776,1777,1779,1780,1782],{},[648,1778,28],{"href":29},": the options of ",[488,1781,494],{}," and its environment variables.",[1178,1784,1785,1788],{},[648,1786,1787],{"href":411},"Media storage",": where uploaded files live.",[1178,1790,1791,1793],{},[648,1792,384],{"href":385},": the database for each host.",[1178,1795,1796,1799],{},[648,1797,1798],{"href":308},"Backup and restore",": copy content between databases.",[1801,1802,1803],"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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":502,"searchDepth":543,"depth":543,"links":1805},[1806,1807,1811,1815,1816,1817,1818,1819],{"id":656,"depth":543,"text":657},{"id":804,"depth":543,"text":711,"children":1808},[1809,1810],{"id":811,"depth":566,"text":812},{"id":937,"depth":566,"text":938},{"id":1201,"depth":543,"text":1202,"children":1812},[1813,1814],{"id":1205,"depth":566,"text":732},{"id":1421,"depth":566,"text":753},{"id":1626,"depth":543,"text":1627},{"id":1641,"depth":543,"text":1642},{"id":1671,"depth":543,"text":1672},{"id":1733,"depth":543,"text":1734},{"id":1771,"depth":543,"text":1772},"Pick a database and connect it.","md",null,{},{"title":406,"description":1820},"prSEPPxoIccMCV058FwzVdrNyJaQ8NfadYQi3sSwXR8",[1827,1829],{"title":259,"path":398,"stem":399,"description":1828,"children":-1},"Run Tenon on Workers, with the CMS in a Durable Object.",{"title":410,"path":411,"stem":412,"description":1830,"children":-1},"Keep media files on disk, in S3 or in R2.",1795884661491]