[{"data":1,"prerenderedAt":1739},["ShallowReactive",2],{"navigation":3,"\u002Fdata-api\u002Fwriting":773,"\u002Fdata-api\u002Fwriting-surround":1734},[4,28,63,85,103,112,269,355,453,485,506,542,576,594,647,669,693,721,747],{"title":5,"path":6,"stem":7,"children":8,"icon":27},"Getting Started","\u002Fgetting-started","01.getting-started\u002F01.index",[9,11,15,19,23],{"title":10,"path":6,"stem":7},"Introduction",{"title":12,"path":13,"stem":14},"Installation","\u002Fgetting-started\u002Finstallation","01.getting-started\u002F02.installation",{"title":16,"path":17,"stem":18},"Quickstart with AI","\u002Fgetting-started\u002Fquickstart-with-ai","01.getting-started\u002F03.quickstart-with-ai",{"title":20,"path":21,"stem":22},"Quickstart by Hand","\u002Fgetting-started\u002Fquickstart-by-hand","01.getting-started\u002F04.quickstart-by-hand",{"title":24,"path":25,"stem":26},"The Admin","\u002Fgetting-started\u002Fadmin-tour","01.getting-started\u002F05.admin-tour","i-lucide-rocket",{"title":29,"icon":30,"path":31,"stem":32,"children":33,"page":62},"Concepts","i-lucide-lightbulb","\u002Fconcepts","02.concepts",[34,38,42,46,50,54,58],{"title":35,"path":36,"stem":37},"PostgreSQL First","\u002Fconcepts\u002Fpostgresql-first","02.concepts\u002F01.postgresql-first",{"title":39,"path":40,"stem":41},"Resources","\u002Fconcepts\u002Fresources","02.concepts\u002F02.resources",{"title":43,"path":44,"stem":45},"Users and Roles","\u002Fconcepts\u002Fusers-and-roles","02.concepts\u002F03.users-and-roles",{"title":47,"path":48,"stem":49},"Permissions","\u002Fconcepts\u002Fpermissions","02.concepts\u002F04.permissions",{"title":51,"path":52,"stem":53},"Drafts and Publishing","\u002Fconcepts\u002Fdrafts-and-publishing","02.concepts\u002F05.drafts-and-publishing",{"title":55,"path":56,"stem":57},"Audit and Events","\u002Fconcepts\u002Faudit-and-events","02.concepts\u002F06.audit-and-events",{"title":59,"path":60,"stem":61},"Object Access","\u002Fconcepts\u002Fobject-access","02.concepts\u002F07.object-access",false,{"title":64,"icon":65,"path":66,"stem":67,"children":68,"page":62},"App","i-lucide-app-window","\u002Fapp","03.app",[69,73,77,81],{"title":70,"path":71,"stem":72},"The App","\u002Fapp\u002Foverview","03.app\u002F01.overview",{"title":74,"path":75,"stem":76},"DataViews","\u002Fapp\u002Fdataviews","03.app\u002F02.dataviews",{"title":78,"path":79,"stem":80},"Dashboards","\u002Fapp\u002Fdashboards","03.app\u002F03.dashboards",{"title":82,"path":83,"stem":84},"Arrange menu","\u002Fapp\u002Farrange-menu","03.app\u002F04.arrange-menu",{"title":86,"icon":87,"path":88,"stem":89,"children":90,"page":62},"Database","i-lucide-database","\u002Fdatabase","04.database",[91,95,99],{"title":92,"path":93,"stem":94},"Tables","\u002Fdatabase\u002Ftables","04.database\u002F01.tables",{"title":96,"path":97,"stem":98},"Views","\u002Fdatabase\u002Fviews","04.database\u002F02.views",{"title":100,"path":101,"stem":102},"Functions","\u002Fdatabase\u002Ffunctions","04.database\u002F03.functions",{"title":104,"icon":105,"path":106,"stem":107,"children":108,"page":62},"SQL Console","i-lucide-square-terminal","\u002Fsql-console","05.sql-console",[109],{"title":104,"path":110,"stem":111},"\u002Fsql-console\u002Foverview","05.sql-console\u002F01.overview",{"title":74,"icon":113,"path":114,"stem":115,"children":116,"page":62},"i-lucide-layout-list","\u002Fdataviews","06.dataviews",[117,121,125,129,183,214],{"title":118,"path":119,"stem":120},"Overview","\u002Fdataviews\u002Foverview","06.dataviews\u002F01.overview",{"title":122,"path":123,"stem":124},"Creating a DataView","\u002Fdataviews\u002Fcreating","06.dataviews\u002F02.creating",{"title":126,"path":127,"stem":128},"Publishing","\u002Fdataviews\u002Fpublishing","06.dataviews\u002F03.publishing",{"title":130,"icon":131,"path":132,"stem":133,"children":134,"page":62},"Types","i-lucide-shapes","\u002Fdataviews\u002Ftypes","06.dataviews\u002F04.types",[135,139,143,147,151,155,159,163,167,171,175,179],{"title":136,"path":137,"stem":138},"Table","\u002Fdataviews\u002Ftypes\u002Ftable","06.dataviews\u002F04.types\u002F01.table",{"title":140,"path":141,"stem":142},"Cards","\u002Fdataviews\u002Ftypes\u002Fcards","06.dataviews\u002F04.types\u002F02.cards",{"title":144,"path":145,"stem":146},"Kanban","\u002Fdataviews\u002Ftypes\u002Fkanban","06.dataviews\u002F04.types\u002F03.kanban",{"title":148,"path":149,"stem":150},"Calendar","\u002Fdataviews\u002Ftypes\u002Fcalendar","06.dataviews\u002F04.types\u002F04.calendar",{"title":152,"path":153,"stem":154},"Gantt","\u002Fdataviews\u002Ftypes\u002Fgantt","06.dataviews\u002F04.types\u002F05.gantt",{"title":156,"path":157,"stem":158},"Map","\u002Fdataviews\u002Ftypes\u002Fmap","06.dataviews\u002F04.types\u002F06.map",{"title":160,"path":161,"stem":162},"Tree","\u002Fdataviews\u002Ftypes\u002Ftree","06.dataviews\u002F04.types\u002F07.tree",{"title":164,"path":165,"stem":166},"Form","\u002Fdataviews\u002Ftypes\u002Fform","06.dataviews\u002F04.types\u002F08.form",{"title":168,"path":169,"stem":170},"Master-detail","\u002Fdataviews\u002Ftypes\u002Fmaster-detail","06.dataviews\u002F04.types\u002F09.master-detail",{"title":172,"path":173,"stem":174},"Settings","\u002Fdataviews\u002Ftypes\u002Fsettings","06.dataviews\u002F04.types\u002F10.settings",{"title":176,"path":177,"stem":178},"Custom","\u002Fdataviews\u002Ftypes\u002Fcustom","06.dataviews\u002F04.types\u002F11.custom",{"title":180,"path":181,"stem":182},"External Frame","\u002Fdataviews\u002Ftypes\u002Fexternal-frame","06.dataviews\u002F04.types\u002F12.external-frame",{"title":172,"icon":184,"path":185,"stem":186,"children":187,"page":62},"i-lucide-settings-2","\u002Fdataviews\u002Fsettings","06.dataviews\u002F05.settings",[188,192,196,199,202,206,210],{"title":189,"path":190,"stem":191},"General","\u002Fdataviews\u002Fsettings\u002Fgeneral","06.dataviews\u002F05.settings\u002F01.general",{"title":193,"path":194,"stem":195},"Data","\u002Fdataviews\u002Fsettings\u002Fdata","06.dataviews\u002F05.settings\u002F02.data",{"title":96,"path":197,"stem":198},"\u002Fdataviews\u002Fsettings\u002Fviews","06.dataviews\u002F05.settings\u002F03.views",{"title":164,"path":200,"stem":201},"\u002Fdataviews\u002Fsettings\u002Fform","06.dataviews\u002F05.settings\u002F04.form",{"title":203,"path":204,"stem":205},"Actions","\u002Fdataviews\u002Fsettings\u002Factions","06.dataviews\u002F05.settings\u002F05.actions",{"title":207,"path":208,"stem":209},"Security","\u002Fdataviews\u002Fsettings\u002Fsecurity","06.dataviews\u002F05.settings\u002F06.security",{"title":211,"path":212,"stem":213},"Versions","\u002Fdataviews\u002Fsettings\u002Fversions","06.dataviews\u002F05.settings\u002F07.versions",{"title":215,"icon":216,"path":217,"stem":218,"children":219,"page":62},"Design Form","i-lucide-pencil-ruler","\u002Fdataviews\u002Fdesign-form","06.dataviews\u002F06.design-form",[220,223,257,261,265],{"title":118,"path":221,"stem":222},"\u002Fdataviews\u002Fdesign-form\u002Foverview","06.dataviews\u002F06.design-form\u002F01.overview",{"title":224,"icon":131,"path":225,"stem":226,"children":227,"page":62},"Widgets","\u002Fdataviews\u002Fdesign-form\u002Fwidgets","06.dataviews\u002F06.design-form\u002F02.widgets",[228,231,234,238,242,246,250,254],{"title":224,"path":229,"stem":230},"\u002Fdataviews\u002Fdesign-form\u002Fwidgets\u002Foverview","06.dataviews\u002F06.design-form\u002F02.widgets\u002F01.overview",{"title":164,"path":232,"stem":233},"\u002Fdataviews\u002Fdesign-form\u002Fwidgets\u002Fform","06.dataviews\u002F06.design-form\u002F02.widgets\u002F02.form",{"title":235,"path":236,"stem":237},"Inputs","\u002Fdataviews\u002Fdesign-form\u002Fwidgets\u002Finputs","06.dataviews\u002F06.design-form\u002F02.widgets\u002F03.inputs",{"title":239,"path":240,"stem":241},"Display","\u002Fdataviews\u002Fdesign-form\u002Fwidgets\u002Fdisplay","06.dataviews\u002F06.design-form\u002F02.widgets\u002F04.display",{"title":243,"path":244,"stem":245},"Embeds","\u002Fdataviews\u002Fdesign-form\u002Fwidgets\u002Fembeds","06.dataviews\u002F06.design-form\u002F02.widgets\u002F05.embeds",{"title":247,"path":248,"stem":249},"Layout","\u002Fdataviews\u002Fdesign-form\u002Fwidgets\u002Flayout","06.dataviews\u002F06.design-form\u002F02.widgets\u002F06.layout",{"title":251,"path":252,"stem":253},"Overlays","\u002Fdataviews\u002Fdesign-form\u002Fwidgets\u002Foverlays","06.dataviews\u002F06.design-form\u002F02.widgets\u002F07.overlays",{"title":203,"path":255,"stem":256},"\u002Fdataviews\u002Fdesign-form\u002Fwidgets\u002Factions","06.dataviews\u002F06.design-form\u002F02.widgets\u002F08.actions",{"title":258,"path":259,"stem":260},"Variables","\u002Fdataviews\u002Fdesign-form\u002Fvariables","06.dataviews\u002F06.design-form\u002F03.variables",{"title":262,"path":263,"stem":264},"Code","\u002Fdataviews\u002Fdesign-form\u002Fcode","06.dataviews\u002F06.design-form\u002F04.code",{"title":266,"path":267,"stem":268},"Formulas","\u002Fdataviews\u002Fdesign-form\u002Fformulas","06.dataviews\u002F06.design-form\u002F05.formulas",{"title":78,"icon":270,"path":271,"stem":272,"children":273,"page":62},"i-lucide-layout-dashboard","\u002Fdashboards","07.dashboards",[274,277,281,285,332],{"title":118,"path":275,"stem":276},"\u002Fdashboards\u002Foverview","07.dashboards\u002F01.overview",{"title":278,"path":279,"stem":280},"Creating a Dashboard","\u002Fdashboards\u002Fcreating","07.dashboards\u002F02.creating",{"title":282,"path":283,"stem":284},"Editor","\u002Fdashboards\u002Feditor","07.dashboards\u002F03.editor",{"title":224,"icon":286,"path":287,"stem":288,"children":289,"page":62},"i-lucide-chart-bar","\u002Fdashboards\u002Fwidgets","07.dashboards\u002F04.widgets",[290,293,297,301,305,309,313,317,321,324,328],{"title":224,"path":291,"stem":292},"\u002Fdashboards\u002Fwidgets\u002Foverview","07.dashboards\u002F04.widgets\u002F01.overview",{"title":294,"path":295,"stem":296},"Editing a Widget","\u002Fdashboards\u002Fwidgets\u002Fediting-a-widget","07.dashboards\u002F04.widgets\u002F02.editing-a-widget",{"title":298,"path":299,"stem":300},"Indicators","\u002Fdashboards\u002Fwidgets\u002Findicators","07.dashboards\u002F04.widgets\u002F03.indicators",{"title":302,"path":303,"stem":304},"Comparison","\u002Fdashboards\u002Fwidgets\u002Fcomparison","07.dashboards\u002F04.widgets\u002F04.comparison",{"title":306,"path":307,"stem":308},"Trend","\u002Fdashboards\u002Fwidgets\u002Ftrend","07.dashboards\u002F04.widgets\u002F05.trend",{"title":310,"path":311,"stem":312},"Proportion","\u002Fdashboards\u002Fwidgets\u002Fproportion","07.dashboards\u002F04.widgets\u002F06.proportion",{"title":314,"path":315,"stem":316},"Distribution and Relation","\u002Fdashboards\u002Fwidgets\u002Fdistribution-and-relation","07.dashboards\u002F04.widgets\u002F07.distribution-and-relation",{"title":318,"path":319,"stem":320},"Maps","\u002Fdashboards\u002Fwidgets\u002Fmaps","07.dashboards\u002F04.widgets\u002F08.maps",{"title":92,"path":322,"stem":323},"\u002Fdashboards\u002Fwidgets\u002Ftables","07.dashboards\u002F04.widgets\u002F09.tables",{"title":325,"path":326,"stem":327},"Visualization and Insertion","\u002Fdashboards\u002Fwidgets\u002Fvisualization-and-insertion","07.dashboards\u002F04.widgets\u002F10.visualization-and-insertion",{"title":329,"path":330,"stem":331},"SQL Conventions","\u002Fdashboards\u002Fwidgets\u002Fsql-conventions","07.dashboards\u002F04.widgets\u002F11.sql-conventions",{"title":172,"icon":184,"path":333,"stem":334,"children":335,"page":62},"\u002Fdashboards\u002Fsettings","07.dashboards\u002F05.settings",[336,339,342,345,349,352],{"title":189,"path":337,"stem":338},"\u002Fdashboards\u002Fsettings\u002Fgeneral","07.dashboards\u002F05.settings\u002F01.general",{"title":258,"path":340,"stem":341},"\u002Fdashboards\u002Fsettings\u002Fvariables","07.dashboards\u002F05.settings\u002F02.variables",{"title":193,"path":343,"stem":344},"\u002Fdashboards\u002Fsettings\u002Fdata","07.dashboards\u002F05.settings\u002F03.data",{"title":346,"path":347,"stem":348},"Share","\u002Fdashboards\u002Fsettings\u002Fshare","07.dashboards\u002F05.settings\u002F04.share",{"title":207,"path":350,"stem":351},"\u002Fdashboards\u002Fsettings\u002Fsecurity","07.dashboards\u002F05.settings\u002F05.security",{"title":211,"path":353,"stem":354},"\u002Fdashboards\u002Fsettings\u002Fversions","07.dashboards\u002F05.settings\u002F06.versions",{"title":356,"icon":357,"path":358,"stem":359,"children":360,"page":62},"Workflows","i-lucide-workflow","\u002Fworkflows","08.workflows",[361,364,368,371,393,432],{"title":118,"path":362,"stem":363},"\u002Fworkflows\u002Foverview","08.workflows\u002F01.overview",{"title":365,"path":366,"stem":367},"Creating a Workflow","\u002Fworkflows\u002Fcreating","08.workflows\u002F02.creating",{"title":282,"path":369,"stem":370},"\u002Fworkflows\u002Feditor","08.workflows\u002F03.editor",{"title":372,"icon":373,"path":374,"stem":375,"children":376,"page":62},"Triggers","i-lucide-zap","\u002Fworkflows\u002Ftriggers","08.workflows\u002F04.triggers",[377,381,385,389],{"title":378,"path":379,"stem":380},"Manual","\u002Fworkflows\u002Ftriggers\u002Fmanual","08.workflows\u002F04.triggers\u002F01.manual",{"title":382,"path":383,"stem":384},"Database Event","\u002Fworkflows\u002Ftriggers\u002Fdatabase-event","08.workflows\u002F04.triggers\u002F02.database-event",{"title":386,"path":387,"stem":388},"Schedule","\u002Fworkflows\u002Ftriggers\u002Fschedule","08.workflows\u002F04.triggers\u002F03.schedule",{"title":390,"path":391,"stem":392},"Webhook","\u002Fworkflows\u002Ftriggers\u002Fwebhook","08.workflows\u002F04.triggers\u002F04.webhook",{"title":394,"icon":357,"path":395,"stem":396,"children":397,"page":62},"Steps","\u002Fworkflows\u002Fsteps","08.workflows\u002F05.steps",[398,401,405,408,412,416,420,424,428],{"title":193,"path":399,"stem":400},"\u002Fworkflows\u002Fsteps\u002Fdata","08.workflows\u002F05.steps\u002F01.data",{"title":402,"path":403,"stem":404},"Control","\u002Fworkflows\u002Fsteps\u002Fcontrol","08.workflows\u002F05.steps\u002F02.control",{"title":262,"path":406,"stem":407},"\u002Fworkflows\u002Fsteps\u002Fcode","08.workflows\u002F05.steps\u002F03.code",{"title":409,"path":410,"stem":411},"Integration","\u002Fworkflows\u002Fsteps\u002Fintegration","08.workflows\u002F05.steps\u002F04.integration",{"title":413,"path":414,"stem":415},"Communication","\u002Fworkflows\u002Fsteps\u002Fcommunication","08.workflows\u002F05.steps\u002F05.communication",{"title":417,"path":418,"stem":419},"Files","\u002Fworkflows\u002Fsteps\u002Ffiles","08.workflows\u002F05.steps\u002F06.files",{"title":421,"path":422,"stem":423},"Documents","\u002Fworkflows\u002Fsteps\u002Fdocuments","08.workflows\u002F05.steps\u002F07.documents",{"title":425,"path":426,"stem":427},"Composition","\u002Fworkflows\u002Fsteps\u002Fcomposition","08.workflows\u002F05.steps\u002F08.composition",{"title":429,"path":430,"stem":431},"Values","\u002Fworkflows\u002Fsteps\u002Fvalues","08.workflows\u002F05.steps\u002F09.values",{"title":172,"icon":184,"path":433,"stem":434,"children":435,"page":62},"\u002Fworkflows\u002Fsettings","08.workflows\u002F06.settings",[436,439,443,446,449],{"title":189,"path":437,"stem":438},"\u002Fworkflows\u002Fsettings\u002Fgeneral","08.workflows\u002F06.settings\u002F01.general",{"title":440,"path":441,"stem":442},"Trigger","\u002Fworkflows\u002Fsettings\u002Ftrigger","08.workflows\u002F06.settings\u002F02.trigger",{"title":207,"path":444,"stem":445},"\u002Fworkflows\u002Fsettings\u002Fsecurity","08.workflows\u002F06.settings\u002F03.security",{"title":211,"path":447,"stem":448},"\u002Fworkflows\u002Fsettings\u002Fversions","08.workflows\u002F06.settings\u002F04.versions",{"title":450,"path":451,"stem":452},"Runs","\u002Fworkflows\u002Fsettings\u002Fruns","08.workflows\u002F06.settings\u002F05.runs",{"title":417,"icon":454,"path":455,"stem":456,"children":457,"page":62},"i-lucide-files","\u002Ffiles","09.files",[458,461,465,469,473,477,481],{"title":118,"path":459,"stem":460},"\u002Ffiles\u002Foverview","09.files\u002F01.overview",{"title":462,"path":463,"stem":464},"Uploading","\u002Ffiles\u002Fuploading","09.files\u002F02.uploading",{"title":466,"path":467,"stem":468},"File Details","\u002Ffiles\u002Ffile-details","09.files\u002F03.file-details",{"title":470,"path":471,"stem":472},"Editing Files","\u002Ffiles\u002Fediting-files","09.files\u002F04.editing-files",{"title":474,"path":475,"stem":476},"Using Files in Tables","\u002Ffiles\u002Fusing-files-in-tables","09.files\u002F05.using-files-in-tables",{"title":478,"path":479,"stem":480},"Image Transformations","\u002Ffiles\u002Fimage-transformations","09.files\u002F06.image-transformations",{"title":482,"path":483,"stem":484},"Who Can See a File","\u002Ffiles\u002Fwho-can-see-a-file","09.files\u002F07.who-can-see-a-file",{"title":486,"icon":487,"path":488,"stem":489,"children":490,"page":62},"Templates","i-lucide-file-text","\u002Ftemplates","10.templates",[491,494,498,502],{"title":118,"path":492,"stem":493},"\u002Ftemplates\u002Foverview","10.templates\u002F01.overview",{"title":495,"path":496,"stem":497},"Emails","\u002Ftemplates\u002Femails","10.templates\u002F02.emails",{"title":499,"path":500,"stem":501},"PDF","\u002Ftemplates\u002Fpdf","10.templates\u002F03.pdf",{"title":503,"path":504,"stem":505},"System Emails","\u002Ftemplates\u002Fsystem-emails","10.templates\u002F04.system-emails",{"title":507,"icon":508,"path":509,"stem":510,"children":511,"page":62},"Users","i-lucide-users","\u002Fusers","11.users",[512,516,520,524,528],{"title":513,"path":514,"stem":515},"Managing Users","\u002Fusers\u002Fmanaging-users","11.users\u002F01.managing-users",{"title":517,"path":518,"stem":519},"A User's Page","\u002Fusers\u002Fa-users-page","11.users\u002F02.a-users-page",{"title":521,"path":522,"stem":523},"API Tokens","\u002Fusers\u002Fapi-tokens","11.users\u002F03.api-tokens",{"title":525,"path":526,"stem":527},"Sessions","\u002Fusers\u002Fsessions","11.users\u002F04.sessions",{"title":529,"icon":530,"path":531,"stem":532,"children":533,"page":62},"Insights","i-lucide-chart-line","\u002Fusers\u002Finsights","11.users\u002F05.insights",[534,538],{"title":535,"path":536,"stem":537},"Sign-ins","\u002Fusers\u002Finsights\u002Fsign-ins","11.users\u002F05.insights\u002F01.sign-ins",{"title":539,"path":540,"stem":541},"Activity","\u002Fusers\u002Finsights\u002Factivity","11.users\u002F05.insights\u002F02.activity",{"title":543,"icon":544,"path":545,"stem":546,"children":547,"page":62},"Roles","i-lucide-shield-check","\u002Froles","12.roles",[548,552,556,560,564,568,572],{"title":549,"path":550,"stem":551},"Creating a Role","\u002Froles\u002Fcreating-a-role","12.roles\u002F01.creating-a-role",{"title":553,"path":554,"stem":555},"Granting Permissions","\u002Froles\u002Fgranting-permissions","12.roles\u002F02.granting-permissions",{"title":557,"path":558,"stem":559},"Row Filters","\u002Froles\u002Frow-filters","12.roles\u002F03.row-filters",{"title":561,"path":562,"stem":563},"Payload Checks","\u002Froles\u002Fpayload-checks","12.roles\u002F04.payload-checks",{"title":565,"path":566,"stem":567},"Members","\u002Froles\u002Fmembers","12.roles\u002F05.members",{"title":569,"path":570,"stem":571},"Access Reviews","\u002Froles\u002Faccess-reviews","12.roles\u002F06.access-reviews",{"title":573,"path":574,"stem":575},"Delegated Administration","\u002Froles\u002Fdelegated-administration","12.roles\u002F07.delegated-administration",{"title":577,"icon":578,"path":579,"stem":580,"children":581,"page":62},"Logs","i-lucide-scroll-text","\u002Flogs","13.logs",[582,586,590],{"title":583,"path":584,"stem":585},"Audit Log","\u002Flogs\u002Faudit-log","13.logs\u002F01.audit-log",{"title":587,"path":588,"stem":589},"An Entry","\u002Flogs\u002Fan-entry","13.logs\u002F02.an-entry",{"title":591,"path":592,"stem":593},"Where Else It Shows","\u002Flogs\u002Fwhere-else-it-shows","13.logs\u002F03.where-else-it-shows",{"title":595,"icon":596,"path":597,"stem":598,"children":599,"page":62},"Data API","i-lucide-braces","\u002Fdata-api","14.data-api",[600,603,607,611,615,619,623,627,631,635,639,643],{"title":118,"path":601,"stem":602},"\u002Fdata-api\u002Foverview","14.data-api\u002F01.overview",{"title":604,"path":605,"stem":606},"Authentication","\u002Fdata-api\u002Fauthentication","14.data-api\u002F02.authentication",{"title":608,"path":609,"stem":610},"Reading","\u002Fdata-api\u002Freading","14.data-api\u002F03.reading",{"title":612,"path":613,"stem":614},"Filtering","\u002Fdata-api\u002Ffiltering","14.data-api\u002F04.filtering",{"title":616,"path":617,"stem":618},"Aggregating","\u002Fdata-api\u002Faggregating","14.data-api\u002F05.aggregating",{"title":620,"path":621,"stem":622},"Writing","\u002Fdata-api\u002Fwriting","14.data-api\u002F06.writing",{"title":624,"path":625,"stem":626},"Nested Writes","\u002Fdata-api\u002Fnested-writes","14.data-api\u002F07.nested-writes",{"title":628,"path":629,"stem":630},"Transactions","\u002Fdata-api\u002Ftransactions","14.data-api\u002F08.transactions",{"title":632,"path":633,"stem":634},"Calling Functions","\u002Fdata-api\u002Fcalling-functions","14.data-api\u002F09.calling-functions",{"title":636,"path":637,"stem":638},"OpenAPI","\u002Fdata-api\u002Fopenapi","14.data-api\u002F10.openapi",{"title":640,"path":641,"stem":642},"Routes","\u002Fdata-api\u002Froutes","14.data-api\u002F11.routes",{"title":644,"path":645,"stem":646},"A client, end to end","\u002Fdata-api\u002Fa-client","14.data-api\u002F12.a-client",{"title":172,"icon":648,"path":649,"stem":650,"children":651,"page":62},"i-lucide-settings","\u002Fsettings","15.settings",[652,655,659,662,665],{"title":189,"path":653,"stem":654},"\u002Fsettings\u002Fgeneral","15.settings\u002F01.general",{"title":656,"path":657,"stem":658},"Access","\u002Fsettings\u002Faccess","15.settings\u002F02.access",{"title":207,"path":660,"stem":661},"\u002Fsettings\u002Fsecurity","15.settings\u002F03.security",{"title":595,"path":663,"stem":664},"\u002Fsettings\u002Fdata-api","15.settings\u002F04.data-api",{"title":666,"path":667,"stem":668},"Features","\u002Fsettings\u002Ffeatures","15.settings\u002F05.features",{"title":670,"icon":671,"path":672,"stem":673,"children":674,"page":62},"User Profile","i-lucide-circle-user","\u002Fuser-profile","16.user-profile",[675,679,682,686,690],{"title":676,"path":677,"stem":678},"My Account","\u002Fuser-profile\u002Fmy-account","16.user-profile\u002F01.my-account",{"title":525,"path":680,"stem":681},"\u002Fuser-profile\u002Fsessions","16.user-profile\u002F02.sessions",{"title":683,"path":684,"stem":685},"Tokens","\u002Fuser-profile\u002Ftokens","16.user-profile\u002F03.tokens",{"title":687,"path":688,"stem":689},"Preferences","\u002Fuser-profile\u002Fpreferences","16.user-profile\u002F04.preferences",{"title":539,"path":691,"stem":692},"\u002Fuser-profile\u002Factivity","16.user-profile\u002F05.activity",{"title":694,"icon":695,"path":696,"stem":697,"children":698,"page":62},"AI Agents","i-lucide-bot","\u002Fai-agents","17.ai-agents",[699,702,705,709,713,717],{"title":118,"path":700,"stem":701},"\u002Fai-agents\u002Foverview","17.ai-agents\u002F01.overview",{"title":683,"path":703,"stem":704},"\u002Fai-agents\u002Ftokens","17.ai-agents\u002F02.tokens",{"title":706,"path":707,"stem":708},"MCP Server","\u002Fai-agents\u002Fmcp-server","17.ai-agents\u002F03.mcp-server",{"title":710,"path":711,"stem":712},"Recipes","\u002Fai-agents\u002Frecipes","17.ai-agents\u002F04.recipes",{"title":714,"path":715,"stem":716},"Tools","\u002Fai-agents\u002Ftools","17.ai-agents\u002F05.tools",{"title":718,"path":719,"stem":720},"llms.txt","\u002Fai-agents\u002Fllms-txt","17.ai-agents\u002F06.llms-txt",{"title":722,"icon":723,"path":724,"stem":725,"children":726,"page":62},"Operations","i-lucide-server","\u002Foperations","18.operations",[727,731,735,739,743],{"title":728,"path":729,"stem":730},"Deployment","\u002Foperations\u002Fdeployment","18.operations\u002F01.deployment",{"title":732,"path":733,"stem":734},"PostgreSQL","\u002Foperations\u002Fpostgresql","18.operations\u002F02.postgresql",{"title":736,"path":737,"stem":738},"Public URL, Proxy and CORS","\u002Foperations\u002Fpublic-url-proxy-cors","18.operations\u002F03.public-url-proxy-cors",{"title":740,"path":741,"stem":742},"Backup and Restore","\u002Foperations\u002Fbackup-restore","18.operations\u002F04.backup-restore",{"title":744,"path":745,"stem":746},"Upgrading","\u002Foperations\u002Fupgrading","18.operations\u002F05.upgrading",{"title":748,"icon":749,"path":750,"stem":751,"children":752,"page":62},"Reference","i-lucide-library","\u002Freference","19.reference",[753,757,761,765,769],{"title":754,"path":755,"stem":756},"Query Language","\u002Freference\u002Fquery-language","19.reference\u002F01.query-language",{"title":758,"path":759,"stem":760},"Errors","\u002Freference\u002Ferrors","19.reference\u002F02.errors",{"title":762,"path":763,"stem":764},"Admin API","\u002Freference\u002Fadmin-api","19.reference\u002F03.admin-api",{"title":766,"path":767,"stem":768},"Authentication API","\u002Freference\u002Fauth-api","19.reference\u002F04.auth-api",{"title":770,"path":771,"stem":772},"Environment Variables","\u002Freference\u002Fenvironment","19.reference\u002F05.environment",{"id":774,"title":620,"admin":775,"body":776,"description":1729,"extension":1730,"links":775,"meta":1731,"navigation":1345,"path":621,"seo":1732,"stem":622,"__hash__":1733},"docs\u002F14.data-api\u002F06.writing.md",null,{"type":777,"value":778,"toc":1716},"minimark",[779,783,788,818,832,944,950,954,957,972,975,990,1005,1013,1017,1032,1053,1057,1071,1075,1088,1120,1170,1177,1181,1190,1262,1265,1317,1324,1328,1331,1361,1379,1383,1390,1410,1425,1439,1443,1558,1562,1577,1674,1695,1699,1712],[780,781,782],"p",{},"Writes go through the same pipeline wherever they come from (this API, a DataView form, a workflow): permissions, PostgreSQL's constraints, the audit log and an event, in one transaction.",[784,785,787],"h2",{"id":786},"create","Create",[789,790,795],"pre",{"className":791,"code":792,"language":793,"meta":794,"style":794},"language-http shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","POST \u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders\n{ \"data\": { \"type\": \"REPAIR\", \"priority\": \"HIGH\", \"site\": \"3c9e…\", \"branch\": \"0b6f…\",\n            \"description\": \"Compressor trips after 10 minutes.\" } }\n","http","",[796,797,798,806,812],"code",{"__ignoreMap":794},[799,800,803],"span",{"class":801,"line":802},"line",1,[799,804,805],{},"POST \u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders\n",[799,807,809],{"class":801,"line":808},2,[799,810,811],{},"{ \"data\": { \"type\": \"REPAIR\", \"priority\": \"HIGH\", \"site\": \"3c9e…\", \"branch\": \"0b6f…\",\n",[799,813,815],{"class":801,"line":814},3,[799,816,817],{},"            \"description\": \"Compressor trips after 10 minutes.\" } }\n",[780,819,820,823,824,827,828,831],{},[796,821,822],{},"201",", with the row as PostgreSQL stored it: defaults, values set by triggers (",[796,825,826],{},"number",", ",[796,829,830],{},"due_at",") and generated columns included.",[789,833,837],{"className":834,"code":835,"language":836,"meta":794,"style":794},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{ \"data\": { \"id\": \"8f1c…\", \"number\": \"WO-000413\", \"status\": \"NEW\", \"due_at\": \"2026-10-15T12:00:00Z\", … } }\n","json",[796,838,839],{"__ignoreMap":794},[799,840,841,845,848,852,855,858,861,863,867,869,871,873,877,879,882,884,886,888,890,892,895,897,899,901,904,906,908,910,913,915,917,919,921,923,925,927,930,932,934,938,941],{"class":801,"line":802},[799,842,844],{"class":843},"sMK4o","{",[799,846,847],{"class":843}," \"",[799,849,851],{"class":850},"spNyl","data",[799,853,854],{"class":843},"\"",[799,856,857],{"class":843},":",[799,859,860],{"class":843}," {",[799,862,847],{"class":843},[799,864,866],{"class":865},"sBMFI","id",[799,868,854],{"class":843},[799,870,857],{"class":843},[799,872,847],{"class":843},[799,874,876],{"class":875},"sfazB","8f1c…",[799,878,854],{"class":843},[799,880,881],{"class":843},",",[799,883,847],{"class":843},[799,885,826],{"class":865},[799,887,854],{"class":843},[799,889,857],{"class":843},[799,891,847],{"class":843},[799,893,894],{"class":875},"WO-000413",[799,896,854],{"class":843},[799,898,881],{"class":843},[799,900,847],{"class":843},[799,902,903],{"class":865},"status",[799,905,854],{"class":843},[799,907,857],{"class":843},[799,909,847],{"class":843},[799,911,912],{"class":875},"NEW",[799,914,854],{"class":843},[799,916,881],{"class":843},[799,918,847],{"class":843},[799,920,830],{"class":865},[799,922,854],{"class":843},[799,924,857],{"class":843},[799,926,847],{"class":843},[799,928,929],{"class":875},"2026-10-15T12:00:00Z",[799,931,854],{"class":843},[799,933,881],{"class":843},[799,935,937],{"class":936},"sTEyZ"," … ",[799,939,940],{"class":843},"}",[799,942,943],{"class":843}," }\n",[780,945,946,949],{},[796,947,948],{},"{ \"data\": {} }"," creates a row from the table's defaults alone.",[784,951,953],{"id":952},"update","Update",[780,955,956],{},"By primary key:",[789,958,960],{"className":791,"code":959,"language":793,"meta":794,"style":794},"PATCH \u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders\u002F8f1c…\n{ \"data\": { \"status\": \"ASSIGNED\", \"technician\": \"e21a…\" } }\n",[796,961,962,967],{"__ignoreMap":794},[799,963,964],{"class":801,"line":802},[799,965,966],{},"PATCH \u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders\u002F8f1c…\n",[799,968,969],{"class":801,"line":808},[799,970,971],{},"{ \"data\": { \"status\": \"ASSIGNED\", \"technician\": \"e21a…\" } }\n",[780,973,974],{},"Or every row matching a filter:",[789,976,978],{"className":791,"code":977,"language":793,"meta":794,"style":794},"PATCH \u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders?where[status][_eq]=NEW&where[site][_eq]=3c9e…\n{ \"data\": { \"priority\": \"URGENT\" } }\n",[796,979,980,985],{"__ignoreMap":794},[799,981,982],{"class":801,"line":802},[799,983,984],{},"PATCH \u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders?where[status][_eq]=NEW&where[site][_eq]=3c9e…\n",[799,986,987],{"class":801,"line":808},[799,988,989],{},"{ \"data\": { \"priority\": \"URGENT\" } }\n",[780,991,992,993,996,997,1000,1001,1004],{},"By key, the answer is the row, or ",[796,994,995],{},"404 ROW_NOT_FOUND"," if it doesn't exist or you can't see it. By filter, it's the list of updated rows, possibly empty. An update without ",[796,998,999],{},"where"," is refused while ",[796,1002,1003],{},"api.require_where_for_update"," is on (the default), so a missing filter never updates a whole table.",[780,1006,1007,1008,1012],{},"Your permissions check each row both before and after the change. See ",[1009,1010,47],"a",{"href":1011},"\u002Fconcepts\u002Fpermissions#writes-check-the-row-before-and-after",".",[784,1014,1016],{"id":1015},"delete","Delete",[789,1018,1020],{"className":791,"code":1019,"language":793,"meta":794,"style":794},"DELETE \u002Fapi\u002Fpublic\u002Ftable\u002Fvisits\u002F77ab…\nDELETE \u002Fapi\u002Fpublic\u002Ftable\u002Fvisits?where[scheduled_start][_lt]=$INTERVAL.1y\n",[796,1021,1022,1027],{"__ignoreMap":794},[799,1023,1024],{"class":801,"line":802},[799,1025,1026],{},"DELETE \u002Fapi\u002Fpublic\u002Ftable\u002Fvisits\u002F77ab…\n",[799,1028,1029],{"class":801,"line":808},[799,1030,1031],{},"DELETE \u002Fapi\u002Fpublic\u002Ftable\u002Fvisits?where[scheduled_start][_lt]=$INTERVAL.1y\n",[780,1033,1034,1035,1038,1039,1000,1041,1044,1045,1048,1049,1052],{},"The answer is ",[796,1036,1037],{},"200"," with what was removed. A delete without ",[796,1040,999],{},[796,1042,1043],{},"api.require_where_for_delete"," is on. Related rows follow your foreign keys: ",[796,1046,1047],{},"ON DELETE CASCADE"," deletes them, and a restricting key makes the delete fail with ",[796,1050,1051],{},"409 FOREIGN_KEY_VIOLATION",". TotalBase never deletes children itself.",[784,1054,1056],{"id":1055},"what-a-write-returns","What a write returns",[780,1058,1059,1060,1063,1064,1067,1068,1070],{},"A write returns what you could read: the fields of your ",[796,1061,1062],{},"READ"," grant. With ",[796,1065,1066],{},"CREATE"," but no ",[796,1069,1062],{},", you get only the primary key. Password columns are never returned.",[784,1072,1074],{"id":1073},"several-rows-at-once","Several rows at once",[780,1076,1077,1080,1081,1083,1084,1087],{},[796,1078,1079],{},"bulk=true"," makes ",[796,1082,851],{}," a list, up to 500 items (",[796,1085,1086],{},"api.bulk_max_items","):",[789,1089,1091],{"className":791,"code":1090,"language":793,"meta":794,"style":794},"POST \u002Fapi\u002Fpublic\u002Ftable\u002Ftime_entries?bulk=true\n{ \"data\": [\n  { \"work_order\": \"8f1c…\", \"technician\": \"e21a…\", \"started_at\": \"2026-10-14T09:00:00Z\", \"ended_at\": \"2026-10-14T11:30:00Z\" },\n  { \"work_order\": \"8f1c…\", \"technician\": \"e21a…\", \"started_at\": \"2026-10-14T12:15:00Z\", \"ended_at\": \"2026-10-14T13:00:00Z\" }\n] }\n",[796,1092,1093,1098,1103,1108,1114],{"__ignoreMap":794},[799,1094,1095],{"class":801,"line":802},[799,1096,1097],{},"POST \u002Fapi\u002Fpublic\u002Ftable\u002Ftime_entries?bulk=true\n",[799,1099,1100],{"class":801,"line":808},[799,1101,1102],{},"{ \"data\": [\n",[799,1104,1105],{"class":801,"line":814},[799,1106,1107],{},"  { \"work_order\": \"8f1c…\", \"technician\": \"e21a…\", \"started_at\": \"2026-10-14T09:00:00Z\", \"ended_at\": \"2026-10-14T11:30:00Z\" },\n",[799,1109,1111],{"class":801,"line":1110},4,[799,1112,1113],{},"  { \"work_order\": \"8f1c…\", \"technician\": \"e21a…\", \"started_at\": \"2026-10-14T12:15:00Z\", \"ended_at\": \"2026-10-14T13:00:00Z\" }\n",[799,1115,1117],{"class":801,"line":1116},5,[799,1118,1119],{},"] }\n",[1121,1122,1123,1136],"table",{},[1124,1125,1126],"thead",{},[1127,1128,1129,1133],"tr",{},[1130,1131,1132],"th",{},"Request",[1130,1134,1135],{},"Each item",[1137,1138,1139,1150,1160],"tbody",{},[1127,1140,1141,1147],{},[1142,1143,1144],"td",{},[796,1145,1146],{},"POST ?bulk=true",[1142,1148,1149],{},"a row to create",[1127,1151,1152,1157],{},[1142,1153,1154],{},[796,1155,1156],{},"PATCH ?bulk=true",[1142,1158,1159],{},"the primary key plus the fields to change",[1127,1161,1162,1167],{},[1142,1163,1164],{},[796,1165,1166],{},"DELETE ?bulk=true",[1142,1168,1169],{},"an object with the primary key",[780,1171,1172,1176],{},[1173,1174,1175],"strong",{},"All or nothing",": the batch runs in one transaction, and one failing item rolls back every item.",[784,1178,1180],{"id":1179},"upserts-on_conflict","Upserts: on_conflict",[780,1182,1183,1184,1187,1188,857],{},"To insert a row or, if it already exists, update it, add ",[796,1185,1186],{},"on_conflict"," beside ",[796,1189,851],{},[789,1191,1193],{"className":791,"code":1192,"language":793,"meta":794,"style":794},"POST \u002Fapi\u002Fpublic\u002Ftable\u002Fparts?bulk=true\n{\n  \"data\": [\n    { \"sku\": \"HV-CAP-35\", \"name\": \"Run capacitor 35 µF\", \"unit_cost\": 4200, \"unit_price\": 7800 },\n    { \"sku\": \"SO-MC4-PR\", \"name\": \"MC4 connector pair\", \"unit_cost\": 1900, \"unit_price\": 3500 }\n  ],\n  \"on_conflict\": {\n    \"target\": [\"sku\"],\n    \"action\": \"UPDATE\",\n    \"data\": { \"unit_cost\": \"$INSERT.unit_cost\", \"unit_price\": \"$INSERT.unit_price\" }\n  }\n}\n",[796,1194,1195,1200,1205,1210,1215,1220,1226,1232,1238,1244,1250,1256],{"__ignoreMap":794},[799,1196,1197],{"class":801,"line":802},[799,1198,1199],{},"POST \u002Fapi\u002Fpublic\u002Ftable\u002Fparts?bulk=true\n",[799,1201,1202],{"class":801,"line":808},[799,1203,1204],{},"{\n",[799,1206,1207],{"class":801,"line":814},[799,1208,1209],{},"  \"data\": [\n",[799,1211,1212],{"class":801,"line":1110},[799,1213,1214],{},"    { \"sku\": \"HV-CAP-35\", \"name\": \"Run capacitor 35 µF\", \"unit_cost\": 4200, \"unit_price\": 7800 },\n",[799,1216,1217],{"class":801,"line":1116},[799,1218,1219],{},"    { \"sku\": \"SO-MC4-PR\", \"name\": \"MC4 connector pair\", \"unit_cost\": 1900, \"unit_price\": 3500 }\n",[799,1221,1223],{"class":801,"line":1222},6,[799,1224,1225],{},"  ],\n",[799,1227,1229],{"class":801,"line":1228},7,[799,1230,1231],{},"  \"on_conflict\": {\n",[799,1233,1235],{"class":801,"line":1234},8,[799,1236,1237],{},"    \"target\": [\"sku\"],\n",[799,1239,1241],{"class":801,"line":1240},9,[799,1242,1243],{},"    \"action\": \"UPDATE\",\n",[799,1245,1247],{"class":801,"line":1246},10,[799,1248,1249],{},"    \"data\": { \"unit_cost\": \"$INSERT.unit_cost\", \"unit_price\": \"$INSERT.unit_price\" }\n",[799,1251,1253],{"class":801,"line":1252},11,[799,1254,1255],{},"  }\n",[799,1257,1259],{"class":801,"line":1258},12,[799,1260,1261],{},"}\n",[780,1263,1264],{},"Acme loads its supplier's price list this way: new parts are created, and known ones get the new prices.",[1266,1267,1268,1279,1304],"ul",{},[1269,1270,1271,1274,1275,1278],"li",{},[796,1272,1273],{},"target"," must be exactly the columns of the primary key or of a ",[796,1276,1277],{},"UNIQUE"," constraint.",[1269,1280,1281,1284,1285,1288,1289,1292,1293,1296,1297,1299,1300,1303],{},[796,1282,1283],{},"action: \"UPDATE\""," updates the existing row with ",[796,1286,1287],{},"on_conflict.data",". ",[796,1290,1291],{},"$INSERT.\u003Ccolumn>"," is the value you tried to insert (PostgreSQL's ",[796,1294,1295],{},"EXCLUDED","). It needs both ",[796,1298,1066],{}," and ",[796,1301,1302],{},"UPDATE"," permission, and a row it updates is checked and audited as an update.",[1269,1305,1306,1309,1310,1312,1313,1316],{},[796,1307,1308],{},"action: \"NOTHING\""," leaves the existing row alone. The answer is ",[796,1311,822],{}," with ",[796,1314,1315],{},"\"data\": null"," for that row.",[780,1318,1319,1320,1323],{},"PostgreSQL resolves the conflict atomically (",[796,1321,1322],{},"INSERT … ON CONFLICT","). There's no read-then-write race. Upserts work for single and bulk creates.",[784,1325,1327],{"id":1326},"optimistic-writes","Optimistic writes",[780,1329,1330],{},"To make sure you don't overwrite someone else's change, send the version you read:",[789,1332,1334],{"className":791,"code":1333,"language":793,"meta":794,"style":794},"GET \u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders\u002F8f1c…          → meta.version \"48213\", ETag \"48213\"\n\nPATCH \u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders\u002F8f1c…\nIf-Match: \"48213\"\n{ \"data\": { \"resolution\": \"Replaced the capacitor.\" } }\n",[796,1335,1336,1341,1347,1351,1356],{"__ignoreMap":794},[799,1337,1338],{"class":801,"line":802},[799,1339,1340],{},"GET \u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders\u002F8f1c…          → meta.version \"48213\", ETag \"48213\"\n",[799,1342,1343],{"class":801,"line":808},[799,1344,1346],{"emptyLinePlaceholder":1345},true,"\n",[799,1348,1349],{"class":801,"line":814},[799,1350,966],{},[799,1352,1353],{"class":801,"line":1110},[799,1354,1355],{},"If-Match: \"48213\"\n",[799,1357,1358],{"class":801,"line":1116},[799,1359,1360],{},"{ \"data\": { \"resolution\": \"Replaced the capacitor.\" } }\n",[780,1362,1363,1364,1367,1368,1371,1372,1299,1375,1378],{},"If the row changed since you read it, the answer is ",[796,1365,1366],{},"409 ROW_VERSION_CONFLICT"," and nothing is written. The version is PostgreSQL's own row version, so there's no column to add. The App's forms do this: saving over someone else's newer change fails instead of overwriting it silently. ",[796,1369,1370],{},"If-Match"," works on ",[796,1373,1374],{},"PATCH",[796,1376,1377],{},"DELETE"," by key.",[784,1380,1382],{"id":1381},"retrying-safely-idempotency-keys","Retrying safely: idempotency keys",[780,1384,1385,1386,1389],{},"A client that times out doesn't know whether its create went through. Send an ",[796,1387,1388],{},"Idempotency-Key"," and retry with the same key:",[789,1391,1393],{"className":791,"code":1392,"language":793,"meta":794,"style":794},"POST \u002Fapi\u002Fpublic\u002Ftable\u002Finvoices\nIdempotency-Key: wo-8f1c-invoice\n{ \"data\": { … } }\n",[796,1394,1395,1400,1405],{"__ignoreMap":794},[799,1396,1397],{"class":801,"line":802},[799,1398,1399],{},"POST \u002Fapi\u002Fpublic\u002Ftable\u002Finvoices\n",[799,1401,1402],{"class":801,"line":808},[799,1403,1404],{},"Idempotency-Key: wo-8f1c-invoice\n",[799,1406,1407],{"class":801,"line":814},[799,1408,1409],{},"{ \"data\": { … } }\n",[780,1411,1412,1413,1416,1417,1420,1421,1424],{},"The first request runs. A repeat with the same key and the same body returns the recorded answer without running again. The same key with a different body is ",[796,1414,1415],{},"409 IDEMPOTENCY_KEY_REUSED",", and a repeat while the first is still running is ",[796,1418,1419],{},"409 IDEMPOTENCY_REQUEST_IN_PROGRESS",". A failed attempt frees the key. Keys last 24 hours (",[796,1422,1423],{},"idempotency.ttl_hours",") and are scoped to your credential and the operation.",[780,1426,1427,1428,1431,1432,1435,1436,1012],{},"Keys work on ",[796,1429,1430],{},"POST"," to tables, on function calls and on transactions. For a table or function that must never be written twice, turn on ",[1173,1433,1434],{},"Require an idempotency key"," under its Endpoints. A request without one then gets ",[796,1437,1438],{},"400 IDEMPOTENCY_KEY_REQUIRED",[784,1440,1442],{"id":1441},"errors-youll-meet","Errors you'll meet",[1121,1444,1445,1458],{},[1124,1446,1447],{},[1127,1448,1449,1452,1455],{},[1130,1450,1451],{},"Error",[1130,1453,1454],{},"Status",[1130,1456,1457],{},"Means",[1137,1459,1460,1473,1485,1502,1517,1533,1545],{},[1127,1461,1462,1467,1470],{},[1142,1463,1464],{},[796,1465,1466],{},"ACTION_DENIED",[1142,1468,1469],{},"403",[1142,1471,1472],{},"no permission for the action, or the row before or after the change is outside your row filter",[1127,1474,1475,1480,1482],{},[1142,1476,1477],{},[796,1478,1479],{},"FIELD_PERMISSION_DENIED",[1142,1481,1469],{},[1142,1483,1484],{},"a field you may not write. Fields are never silently dropped.",[1127,1486,1487,1492,1495],{},[1142,1488,1489],{},[796,1490,1491],{},"PAYLOAD_CHECK_FAILED",[1142,1493,1494],{},"422",[1142,1496,1497,1498,1501],{},"a ",[1009,1499,1500],{"href":562},"payload check"," refused the values",[1127,1503,1504,1512,1514],{},[1142,1505,1506,827,1509],{},[796,1507,1508],{},"NOT_NULL_VIOLATION",[796,1510,1511],{},"CHECK_VIOLATION",[1142,1513,1494],{},[1142,1515,1516],{},"PostgreSQL refused the values",[1127,1518,1519,1527,1530],{},[1142,1520,1521,827,1524],{},[796,1522,1523],{},"UNIQUE_VIOLATION",[796,1525,1526],{},"FOREIGN_KEY_VIOLATION",[1142,1528,1529],{},"409",[1142,1531,1532],{},"PostgreSQL refused because of other rows",[1127,1534,1535,1540,1542],{},[1142,1536,1537],{},[796,1538,1539],{},"RAISE_EXCEPTION",[1142,1541,1494],{},[1142,1543,1544],{},"a trigger or function refused, with its own message",[1127,1546,1547,1552,1555],{},[1142,1548,1549],{},[796,1550,1551],{},"GENERATED_ALWAYS",[1142,1553,1554],{},"400",[1142,1556,1557],{},"you wrote a column PostgreSQL computes",[784,1559,1561],{"id":1560},"the-sql-it-runs","The SQL it runs",[780,1563,1564,1565,1568,1569,1572,1573,857],{},"This is the SQL TotalBase sent to PostgreSQL for the example above, as PostgreSQL's own log recorded it - ids shortened, long column lists cut with ",[796,1566,1567],{},"…",". Every value travels as a parameter (",[796,1570,1571],{},"$1","), never inside the SQL text. Here, a dispatcher assigns an order by its key; their role's row filter is ",[1574,1575,1576],"em",{},"their branch",[789,1578,1582],{"className":1579,"code":1580,"language":1581,"meta":794,"style":794},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","BEGIN;\nSELECT set_config('statement_timeout', '30000', true),\n       set_config('totalbase.actor_user_id', 'a26c…', true);\nWITH old_rows AS (\n  SELECT t0.\"id\" AS __old_key_0, t0.\"status\" AS __old_4, …    -- the row before, for the audit's changes\n  FROM \"public\".\"work_orders\" AS t0\n  WHERE t0.\"id\" = $3 AND t0.\"branch\" = $4                     -- the old row must pass the filter\n  FOR UPDATE OF t0\n), upd AS (\n  UPDATE \"public\".\"work_orders\" AS t0 SET \"status\" = $1, \"technician\" = $2\n  FROM old_rows WHERE t0.\"id\" = old_rows.__old_key_0\n  RETURNING t0.*, t0.xmin::text AS __version, old_rows.*\n)\nSELECT *, (upd.\"branch\" = $5) AS __authorized FROM upd;       -- and so must the new one\nINSERT INTO totalbase.logs (…) SELECT … FROM jsonb_array_elements($1::jsonb) …;    -- its audit entry\nINSERT INTO totalbase.outbox (…) SELECT … FROM jsonb_array_elements($1::jsonb) …;  -- its event, for webhooks and workflows\nCOMMIT;\n","sql",[796,1583,1584,1589,1594,1599,1604,1609,1614,1619,1624,1629,1634,1639,1644,1650,1656,1662,1668],{"__ignoreMap":794},[799,1585,1586],{"class":801,"line":802},[799,1587,1588],{},"BEGIN;\n",[799,1590,1591],{"class":801,"line":808},[799,1592,1593],{},"SELECT set_config('statement_timeout', '30000', true),\n",[799,1595,1596],{"class":801,"line":814},[799,1597,1598],{},"       set_config('totalbase.actor_user_id', 'a26c…', true);\n",[799,1600,1601],{"class":801,"line":1110},[799,1602,1603],{},"WITH old_rows AS (\n",[799,1605,1606],{"class":801,"line":1116},[799,1607,1608],{},"  SELECT t0.\"id\" AS __old_key_0, t0.\"status\" AS __old_4, …    -- the row before, for the audit's changes\n",[799,1610,1611],{"class":801,"line":1222},[799,1612,1613],{},"  FROM \"public\".\"work_orders\" AS t0\n",[799,1615,1616],{"class":801,"line":1228},[799,1617,1618],{},"  WHERE t0.\"id\" = $3 AND t0.\"branch\" = $4                     -- the old row must pass the filter\n",[799,1620,1621],{"class":801,"line":1234},[799,1622,1623],{},"  FOR UPDATE OF t0\n",[799,1625,1626],{"class":801,"line":1240},[799,1627,1628],{},"), upd AS (\n",[799,1630,1631],{"class":801,"line":1246},[799,1632,1633],{},"  UPDATE \"public\".\"work_orders\" AS t0 SET \"status\" = $1, \"technician\" = $2\n",[799,1635,1636],{"class":801,"line":1252},[799,1637,1638],{},"  FROM old_rows WHERE t0.\"id\" = old_rows.__old_key_0\n",[799,1640,1641],{"class":801,"line":1258},[799,1642,1643],{},"  RETURNING t0.*, t0.xmin::text AS __version, old_rows.*\n",[799,1645,1647],{"class":801,"line":1646},13,[799,1648,1649],{},")\n",[799,1651,1653],{"class":801,"line":1652},14,[799,1654,1655],{},"SELECT *, (upd.\"branch\" = $5) AS __authorized FROM upd;       -- and so must the new one\n",[799,1657,1659],{"class":801,"line":1658},15,[799,1660,1661],{},"INSERT INTO totalbase.logs (…) SELECT … FROM jsonb_array_elements($1::jsonb) …;    -- its audit entry\n",[799,1663,1665],{"class":801,"line":1664},16,[799,1666,1667],{},"INSERT INTO totalbase.outbox (…) SELECT … FROM jsonb_array_elements($1::jsonb) …;  -- its event, for webhooks and workflows\n",[799,1669,1671],{"class":801,"line":1670},17,[799,1672,1673],{},"COMMIT;\n",[780,1675,1676,1677,1679,1680,1683,1684,1288,1687,1690,1691,1012],{},"A row outside the filter is never selected, so it isn't touched: ",[796,1678,995],{},". A new row that leaves the filter, such as moving the order to another branch, comes back with ",[796,1681,1682],{},"__authorized"," false and the transaction is rolled back: ",[796,1685,1686],{},"403 ACTION_DENIED",[796,1688,1689],{},"xmin"," is the row's version, the ETag of ",[1009,1692,1694],{"href":1693},"#optimistic-writes","optimistic writes",[784,1696,1698],{"id":1697},"next-steps","Next steps",[1266,1700,1701,1707],{},[1269,1702,1703,1706],{},[1009,1704,1705],{"href":625},"Nested writes",": a row with its children.",[1269,1708,1709,1711],{},[1009,1710,628],{"href":629},": several writes on different tables.",[1713,1714,1715],"style",{},"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}",{"title":794,"searchDepth":802,"depth":808,"links":1717},[1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728],{"id":786,"depth":808,"text":787},{"id":952,"depth":808,"text":953},{"id":1015,"depth":808,"text":1016},{"id":1055,"depth":808,"text":1056},{"id":1073,"depth":808,"text":1074},{"id":1179,"depth":808,"text":1180},{"id":1326,"depth":808,"text":1327},{"id":1381,"depth":808,"text":1382},{"id":1441,"depth":808,"text":1442},{"id":1560,"depth":808,"text":1561},{"id":1697,"depth":808,"text":1698},"Create, update and delete rows - one, many, or by filter - with upserts, optimistic concurrency and idempotency keys.","md",{},{"title":620,"description":1729},"XyI-uRzUTK8I8ITILZ7jf7SnMDQXB1ujGN2b-uFjhFQ",[1735,1737],{"title":616,"path":617,"stem":618,"description":1736,"children":-1},"Totals, counts, averages and groups: _sum, _count, _avg, _min, _max, group_by and having.",{"title":624,"path":625,"stem":626,"description":1738,"children":-1},"Create a row together with its children - a quote with its items - in one request and one transaction.",1792339953595]