[{"data":1,"prerenderedAt":2999},["ShallowReactive",2],{"navigation":3,"\u002Fdata-api\u002Fa-client":773,"\u002Fdata-api\u002Fa-client-surround":2994},[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":644,"admin":775,"body":776,"description":2989,"extension":2990,"links":775,"meta":2991,"navigation":849,"path":645,"seo":2992,"stem":646,"__hash__":2993},"docs\u002F14.data-api\u002F12.a-client.md",null,{"type":777,"value":778,"toc":2979},"minimark",[779,788,793,808,1125,1129,1144,1759,1763,1797,2133,2144,2148,2170,2362,2371,2375,2394,2621,2625,2636,2877,2881,2890,2946,2951,2955,2975],[780,781,782,783,787],"p",{},"The other Data API pages cover one topic each. This one puts them together: a client for Acme's work orders, in TypeScript with plain ",[784,785,786],"code",{},"fetch"," and no dependencies. Every request it makes is one of those pages' examples, so each step links to the details.",[789,790,792],"h2",{"id":791},"_1-sign-in-or-use-a-token","1. Sign in, or use a token",[780,794,795,796,799,800,804,805,807],{},"A person signs in with their email and password and gets a session token. A program uses a personal access token (",[784,797,798],{},"tb_…",") instead, created in ",[801,802,803],"a",{"href":522},"API tokens",". Both go in the same header. See ",[801,806,604],{"href":605},".",[809,810,815],"pre",{"className":811,"code":812,"language":813,"meta":814,"style":814},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const BASE = 'https:\u002F\u002Fops.acme-field.example'\n\nasync function signIn(email: string, password: string): Promise\u003Cstring> {\n  const res = await fetch(`${BASE}\u002Fapi\u002Fauth\u002Flogin`, {\n    method: 'POST',\n    headers: { 'content-type': 'application\u002Fjson' },\n    body: JSON.stringify({ email, password }), \u002F\u002F auth routes take their fields directly, not in `data`\n  })\n  if (!res.ok) throw new Error('Invalid email or password')\n  return (await res.json()).data.token\n}\n","ts","",[784,816,817,844,851,906,947,966,996,1036,1045,1088,1119],{"__ignoreMap":814},[818,819,822,826,830,834,837,841],"span",{"class":820,"line":821},"line",1,[818,823,825],{"class":824},"spNyl","const",[818,827,829],{"class":828},"sTEyZ"," BASE ",[818,831,833],{"class":832},"sMK4o","=",[818,835,836],{"class":832}," '",[818,838,840],{"class":839},"sfazB","https:\u002F\u002Fops.acme-field.example",[818,842,843],{"class":832},"'\n",[818,845,847],{"class":820,"line":846},2,[818,848,850],{"emptyLinePlaceholder":849},true,"\n",[818,852,854,857,860,864,867,871,874,878,881,884,886,888,891,894,897,900,903],{"class":820,"line":853},3,[818,855,856],{"class":824},"async",[818,858,859],{"class":824}," function",[818,861,863],{"class":862},"s2Zo4"," signIn",[818,865,866],{"class":832},"(",[818,868,870],{"class":869},"sHdIc","email",[818,872,873],{"class":832},":",[818,875,877],{"class":876},"sBMFI"," string",[818,879,880],{"class":832},",",[818,882,883],{"class":869}," password",[818,885,873],{"class":832},[818,887,877],{"class":876},[818,889,890],{"class":832},"):",[818,892,893],{"class":876}," Promise",[818,895,896],{"class":832},"\u003C",[818,898,899],{"class":876},"string",[818,901,902],{"class":832},">",[818,904,905],{"class":832}," {\n",[818,907,909,912,915,918,922,925,928,931,934,937,940,943,945],{"class":820,"line":908},4,[818,910,911],{"class":824},"  const",[818,913,914],{"class":828}," res",[818,916,917],{"class":832}," =",[818,919,921],{"class":920},"s7zQu"," await",[818,923,924],{"class":862}," fetch",[818,926,866],{"class":927},"swJcz",[818,929,930],{"class":832},"`${",[818,932,933],{"class":828},"BASE",[818,935,936],{"class":832},"}",[818,938,939],{"class":839},"\u002Fapi\u002Fauth\u002Flogin",[818,941,942],{"class":832},"`",[818,944,880],{"class":832},[818,946,905],{"class":832},[818,948,950,953,955,957,960,963],{"class":820,"line":949},5,[818,951,952],{"class":927},"    method",[818,954,873],{"class":832},[818,956,836],{"class":832},[818,958,959],{"class":839},"POST",[818,961,962],{"class":832},"'",[818,964,965],{"class":832},",\n",[818,967,969,972,974,977,979,982,984,986,988,991,993],{"class":820,"line":968},6,[818,970,971],{"class":927},"    headers",[818,973,873],{"class":832},[818,975,976],{"class":832}," {",[818,978,836],{"class":832},[818,980,981],{"class":927},"content-type",[818,983,962],{"class":832},[818,985,873],{"class":832},[818,987,836],{"class":832},[818,989,990],{"class":839},"application\u002Fjson",[818,992,962],{"class":832},[818,994,995],{"class":832}," },\n",[818,997,999,1002,1004,1007,1009,1012,1014,1017,1020,1022,1024,1027,1030,1032],{"class":820,"line":998},7,[818,1000,1001],{"class":927},"    body",[818,1003,873],{"class":832},[818,1005,1006],{"class":828}," JSON",[818,1008,807],{"class":832},[818,1010,1011],{"class":862},"stringify",[818,1013,866],{"class":927},[818,1015,1016],{"class":832},"{",[818,1018,1019],{"class":828}," email",[818,1021,880],{"class":832},[818,1023,883],{"class":828},[818,1025,1026],{"class":832}," }",[818,1028,1029],{"class":927},")",[818,1031,880],{"class":832},[818,1033,1035],{"class":1034},"sHwdD"," \u002F\u002F auth routes take their fields directly, not in `data`\n",[818,1037,1039,1042],{"class":820,"line":1038},8,[818,1040,1041],{"class":832},"  }",[818,1043,1044],{"class":927},")\n",[818,1046,1048,1051,1054,1057,1060,1062,1065,1068,1071,1074,1077,1079,1081,1084,1086],{"class":820,"line":1047},9,[818,1049,1050],{"class":920},"  if",[818,1052,1053],{"class":927}," (",[818,1055,1056],{"class":832},"!",[818,1058,1059],{"class":828},"res",[818,1061,807],{"class":832},[818,1063,1064],{"class":828},"ok",[818,1066,1067],{"class":927},") ",[818,1069,1070],{"class":920},"throw",[818,1072,1073],{"class":832}," new",[818,1075,1076],{"class":862}," Error",[818,1078,866],{"class":927},[818,1080,962],{"class":832},[818,1082,1083],{"class":839},"Invalid email or password",[818,1085,962],{"class":832},[818,1087,1044],{"class":927},[818,1089,1091,1094,1096,1099,1101,1103,1106,1109,1111,1114,1116],{"class":820,"line":1090},10,[818,1092,1093],{"class":920},"  return",[818,1095,1053],{"class":927},[818,1097,1098],{"class":920},"await",[818,1100,914],{"class":828},[818,1102,807],{"class":832},[818,1104,1105],{"class":862},"json",[818,1107,1108],{"class":927},"())",[818,1110,807],{"class":832},[818,1112,1113],{"class":828},"data",[818,1115,807],{"class":832},[818,1117,1118],{"class":828},"token\n",[818,1120,1122],{"class":820,"line":1121},11,[818,1123,1124],{"class":832},"}\n",[789,1126,1128],{"id":1127},"_2-one-function-for-every-call","2. One function for every call",[780,1130,1131,1132,1135,1136,1139,1140,807],{},"Every route answers ",[784,1133,1134],{},"{ data, meta? }",", or ",[784,1137,1138],{},"{ errors: [...] }"," on a failure. One helper unwraps both, so the rest of the client never parses responses. See ",[801,1141,1143],{"href":1142},"\u002Fdata-api\u002Foverview#request-and-response","Request and response",[809,1145,1147],{"className":811,"code":1146,"language":813,"meta":814,"style":814},"interface ApiError { code: string; message: string; field?: string; source: 'TOTALBASE' | 'POSTGRESQL' }\n\nclass DataApiError extends Error {\n  constructor(public status: number, public errors: ApiError[]) { super(errors[0]?.message ?? `HTTP ${status}`) }\n  get code() { return this.errors[0]?.code }\n  \u002F** The column an error is about - show it beside that field. *\u002F\n  get field() { return this.errors[0]?.field }\n}\n\nasync function api\u003CT>(token: string, path: string, init: RequestInit = {}): Promise\u003C{ data: T; meta?: Record\u003Cstring, unknown>; etag?: string }> {\n  const res = await fetch(`${BASE}${path}`, {\n    ...init,\n    headers: { authorization: `Bearer ${token}`, 'content-type': 'application\u002Fjson', ...init.headers },\n  })\n  if (res.status === 204) return { data: undefined as T }\n  const body = await res.json()\n  if (!res.ok) throw new DataApiError(res.status, body.errors)\n  return { data: body.data, meta: body.meta, etag: res.headers.get('etag') ?? undefined }\n}\n",[784,1148,1149,1213,1217,1232,1315,1347,1352,1381,1385,1389,1484,1514,1525,1580,1587,1627,1648,1689,1754],{"__ignoreMap":814},[818,1150,1151,1154,1157,1159,1162,1164,1166,1169,1172,1174,1176,1178,1181,1184,1186,1188,1191,1193,1195,1198,1200,1203,1205,1208,1210],{"class":820,"line":821},[818,1152,1153],{"class":824},"interface",[818,1155,1156],{"class":876}," ApiError",[818,1158,976],{"class":832},[818,1160,1161],{"class":927}," code",[818,1163,873],{"class":832},[818,1165,877],{"class":876},[818,1167,1168],{"class":832},";",[818,1170,1171],{"class":927}," message",[818,1173,873],{"class":832},[818,1175,877],{"class":876},[818,1177,1168],{"class":832},[818,1179,1180],{"class":927}," field",[818,1182,1183],{"class":832},"?:",[818,1185,877],{"class":876},[818,1187,1168],{"class":832},[818,1189,1190],{"class":927}," source",[818,1192,873],{"class":832},[818,1194,836],{"class":832},[818,1196,1197],{"class":839},"TOTALBASE",[818,1199,962],{"class":832},[818,1201,1202],{"class":832}," |",[818,1204,836],{"class":832},[818,1206,1207],{"class":839},"POSTGRESQL",[818,1209,962],{"class":832},[818,1211,1212],{"class":832}," }\n",[818,1214,1215],{"class":820,"line":846},[818,1216,850],{"emptyLinePlaceholder":849},[818,1218,1219,1222,1225,1228,1230],{"class":820,"line":853},[818,1220,1221],{"class":824},"class",[818,1223,1224],{"class":876}," DataApiError",[818,1226,1227],{"class":824}," extends",[818,1229,1076],{"class":876},[818,1231,905],{"class":832},[818,1233,1234,1237,1239,1242,1245,1247,1250,1252,1255,1258,1260,1262,1265,1267,1269,1272,1274,1277,1280,1284,1287,1290,1293,1296,1299,1302,1305,1308,1311,1313],{"class":820,"line":908},[818,1235,1236],{"class":824},"  constructor",[818,1238,866],{"class":832},[818,1240,1241],{"class":824},"public",[818,1243,1244],{"class":869}," status",[818,1246,873],{"class":832},[818,1248,1249],{"class":876}," number",[818,1251,880],{"class":832},[818,1253,1254],{"class":824}," public",[818,1256,1257],{"class":869}," errors",[818,1259,873],{"class":832},[818,1261,1156],{"class":876},[818,1263,1264],{"class":828},"[]",[818,1266,1029],{"class":832},[818,1268,976],{"class":832},[818,1270,1271],{"class":828}," super",[818,1273,866],{"class":927},[818,1275,1276],{"class":828},"errors",[818,1278,1279],{"class":927},"[",[818,1281,1283],{"class":1282},"sbssI","0",[818,1285,1286],{"class":927},"]",[818,1288,1289],{"class":832},"?.",[818,1291,1292],{"class":828},"message",[818,1294,1295],{"class":832}," ??",[818,1297,1298],{"class":832}," `",[818,1300,1301],{"class":839},"HTTP ",[818,1303,1304],{"class":832},"${",[818,1306,1307],{"class":828},"status",[818,1309,1310],{"class":832},"}`",[818,1312,1067],{"class":927},[818,1314,1124],{"class":832},[818,1316,1317,1320,1322,1325,1327,1330,1333,1335,1337,1339,1341,1343,1345],{"class":820,"line":949},[818,1318,1319],{"class":824},"  get",[818,1321,1161],{"class":927},[818,1323,1324],{"class":832},"()",[818,1326,976],{"class":832},[818,1328,1329],{"class":920}," return",[818,1331,1332],{"class":832}," this.",[818,1334,1276],{"class":828},[818,1336,1279],{"class":927},[818,1338,1283],{"class":1282},[818,1340,1286],{"class":927},[818,1342,1289],{"class":832},[818,1344,784],{"class":828},[818,1346,1212],{"class":832},[818,1348,1349],{"class":820,"line":968},[818,1350,1351],{"class":1034},"  \u002F** The column an error is about - show it beside that field. *\u002F\n",[818,1353,1354,1356,1358,1360,1362,1364,1366,1368,1370,1372,1374,1376,1379],{"class":820,"line":998},[818,1355,1319],{"class":824},[818,1357,1180],{"class":927},[818,1359,1324],{"class":832},[818,1361,976],{"class":832},[818,1363,1329],{"class":920},[818,1365,1332],{"class":832},[818,1367,1276],{"class":828},[818,1369,1279],{"class":927},[818,1371,1283],{"class":1282},[818,1373,1286],{"class":927},[818,1375,1289],{"class":832},[818,1377,1378],{"class":828},"field",[818,1380,1212],{"class":832},[818,1382,1383],{"class":820,"line":1038},[818,1384,1124],{"class":832},[818,1386,1387],{"class":820,"line":1047},[818,1388,850],{"emptyLinePlaceholder":849},[818,1390,1391,1393,1395,1398,1400,1403,1406,1409,1411,1413,1415,1418,1420,1422,1424,1427,1429,1432,1434,1437,1439,1442,1445,1447,1450,1452,1455,1457,1460,1462,1464,1466,1469,1472,1475,1477,1479,1482],{"class":820,"line":1090},[818,1392,856],{"class":824},[818,1394,859],{"class":824},[818,1396,1397],{"class":862}," api",[818,1399,896],{"class":832},[818,1401,1402],{"class":876},"T",[818,1404,1405],{"class":832},">(",[818,1407,1408],{"class":869},"token",[818,1410,873],{"class":832},[818,1412,877],{"class":876},[818,1414,880],{"class":832},[818,1416,1417],{"class":869}," path",[818,1419,873],{"class":832},[818,1421,877],{"class":876},[818,1423,880],{"class":832},[818,1425,1426],{"class":869}," init",[818,1428,873],{"class":832},[818,1430,1431],{"class":876}," RequestInit",[818,1433,917],{"class":832},[818,1435,1436],{"class":832}," {}):",[818,1438,893],{"class":876},[818,1440,1441],{"class":832},"\u003C{",[818,1443,1444],{"class":927}," data",[818,1446,873],{"class":832},[818,1448,1449],{"class":876}," T",[818,1451,1168],{"class":832},[818,1453,1454],{"class":927}," meta",[818,1456,1183],{"class":832},[818,1458,1459],{"class":876}," Record",[818,1461,896],{"class":832},[818,1463,899],{"class":876},[818,1465,880],{"class":832},[818,1467,1468],{"class":876}," unknown",[818,1470,1471],{"class":832},">;",[818,1473,1474],{"class":927}," etag",[818,1476,1183],{"class":832},[818,1478,877],{"class":876},[818,1480,1481],{"class":832}," }>",[818,1483,905],{"class":832},[818,1485,1486,1488,1490,1492,1494,1496,1498,1500,1502,1505,1508,1510,1512],{"class":820,"line":1121},[818,1487,911],{"class":824},[818,1489,914],{"class":828},[818,1491,917],{"class":832},[818,1493,921],{"class":920},[818,1495,924],{"class":862},[818,1497,866],{"class":927},[818,1499,930],{"class":832},[818,1501,933],{"class":828},[818,1503,1504],{"class":832},"}${",[818,1506,1507],{"class":828},"path",[818,1509,1310],{"class":832},[818,1511,880],{"class":832},[818,1513,905],{"class":832},[818,1515,1517,1520,1523],{"class":820,"line":1516},12,[818,1518,1519],{"class":832},"    ...",[818,1521,1522],{"class":828},"init",[818,1524,965],{"class":832},[818,1526,1528,1530,1532,1534,1537,1539,1541,1544,1546,1548,1550,1552,1554,1556,1558,1560,1562,1564,1566,1568,1571,1573,1575,1578],{"class":820,"line":1527},13,[818,1529,971],{"class":927},[818,1531,873],{"class":832},[818,1533,976],{"class":832},[818,1535,1536],{"class":927}," authorization",[818,1538,873],{"class":832},[818,1540,1298],{"class":832},[818,1542,1543],{"class":839},"Bearer ",[818,1545,1304],{"class":832},[818,1547,1408],{"class":828},[818,1549,1310],{"class":832},[818,1551,880],{"class":832},[818,1553,836],{"class":832},[818,1555,981],{"class":927},[818,1557,962],{"class":832},[818,1559,873],{"class":832},[818,1561,836],{"class":832},[818,1563,990],{"class":839},[818,1565,962],{"class":832},[818,1567,880],{"class":832},[818,1569,1570],{"class":832}," ...",[818,1572,1522],{"class":828},[818,1574,807],{"class":832},[818,1576,1577],{"class":828},"headers",[818,1579,995],{"class":832},[818,1581,1583,1585],{"class":820,"line":1582},14,[818,1584,1041],{"class":832},[818,1586,1044],{"class":927},[818,1588,1590,1592,1594,1596,1598,1600,1603,1606,1608,1611,1613,1615,1617,1620,1623,1625],{"class":820,"line":1589},15,[818,1591,1050],{"class":920},[818,1593,1053],{"class":927},[818,1595,1059],{"class":828},[818,1597,807],{"class":832},[818,1599,1307],{"class":828},[818,1601,1602],{"class":832}," ===",[818,1604,1605],{"class":1282}," 204",[818,1607,1067],{"class":927},[818,1609,1610],{"class":920},"return",[818,1612,976],{"class":832},[818,1614,1444],{"class":927},[818,1616,873],{"class":832},[818,1618,1619],{"class":832}," undefined",[818,1621,1622],{"class":920}," as",[818,1624,1449],{"class":876},[818,1626,1212],{"class":832},[818,1628,1630,1632,1635,1637,1639,1641,1643,1645],{"class":820,"line":1629},16,[818,1631,911],{"class":824},[818,1633,1634],{"class":828}," body",[818,1636,917],{"class":832},[818,1638,921],{"class":920},[818,1640,914],{"class":828},[818,1642,807],{"class":832},[818,1644,1105],{"class":862},[818,1646,1647],{"class":927},"()\n",[818,1649,1651,1653,1655,1657,1659,1661,1663,1665,1667,1669,1671,1673,1675,1677,1679,1681,1683,1685,1687],{"class":820,"line":1650},17,[818,1652,1050],{"class":920},[818,1654,1053],{"class":927},[818,1656,1056],{"class":832},[818,1658,1059],{"class":828},[818,1660,807],{"class":832},[818,1662,1064],{"class":828},[818,1664,1067],{"class":927},[818,1666,1070],{"class":920},[818,1668,1073],{"class":832},[818,1670,1224],{"class":862},[818,1672,866],{"class":927},[818,1674,1059],{"class":828},[818,1676,807],{"class":832},[818,1678,1307],{"class":828},[818,1680,880],{"class":832},[818,1682,1634],{"class":828},[818,1684,807],{"class":832},[818,1686,1276],{"class":828},[818,1688,1044],{"class":927},[818,1690,1692,1694,1696,1698,1700,1702,1704,1706,1708,1710,1712,1714,1716,1719,1721,1723,1725,1727,1729,1731,1733,1736,1738,1740,1743,1745,1747,1750,1752],{"class":820,"line":1691},18,[818,1693,1093],{"class":920},[818,1695,976],{"class":832},[818,1697,1444],{"class":927},[818,1699,873],{"class":832},[818,1701,1634],{"class":828},[818,1703,807],{"class":832},[818,1705,1113],{"class":828},[818,1707,880],{"class":832},[818,1709,1454],{"class":927},[818,1711,873],{"class":832},[818,1713,1634],{"class":828},[818,1715,807],{"class":832},[818,1717,1718],{"class":828},"meta",[818,1720,880],{"class":832},[818,1722,1474],{"class":927},[818,1724,873],{"class":832},[818,1726,914],{"class":828},[818,1728,807],{"class":832},[818,1730,1577],{"class":828},[818,1732,807],{"class":832},[818,1734,1735],{"class":862},"get",[818,1737,866],{"class":927},[818,1739,962],{"class":832},[818,1741,1742],{"class":839},"etag",[818,1744,962],{"class":832},[818,1746,1067],{"class":927},[818,1748,1749],{"class":832},"??",[818,1751,1619],{"class":832},[818,1753,1212],{"class":832},[818,1755,1757],{"class":820,"line":1756},19,[818,1758,1124],{"class":832},[789,1760,1762],{"id":1761},"_3-list-with-a-filter-a-relation-and-a-page","3. List with a filter, a relation and a page",[780,1764,1765,1768,1769,1772,1773,1776,1777,1780,1781,1784,1785,1788,1789,1792,1793,1784,1795,807],{},[784,1766,1767],{},"fields"," chooses columns and follows foreign keys with a dot (",[784,1770,1771],{},"site.name"," reads the site's name in the same request). ",[784,1774,1775],{},"where"," filters, ",[784,1778,1779],{},"order_by"," sorts, ",[784,1782,1783],{},"limit"," and ",[784,1786,1787],{},"offset"," page, and ",[784,1790,1791],{},"count=true"," adds the total. See ",[801,1794,608],{"href":609},[801,1796,612],{"href":613},[809,1798,1800],{"className":811,"code":1799,"language":813,"meta":814,"style":814},"interface Order { id: string; number: string; status: string; priority: string; 'site.name': string; due_at: string }\n\nasync function openOrders(token: string, page = 0, pageSize = 20) {\n  const query = new URLSearchParams({\n    fields: 'id,number,status,priority,site.name,due_at',\n    'where[status][_in]': 'NEW,ASSIGNED,IN_PROGRESS',\n    order_by: 'due_at',\n    limit: String(pageSize),\n    offset: String(page * pageSize),\n    count: 'true',\n  })\n  const { data, meta } = await api\u003COrder[]>(token, `\u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders?${query}`)\n  return { orders: data, total: meta?.count as number }\n}\n",[784,1801,1802,1866,1870,1911,1930,1946,1967,1983,2002,2025,2041,2047,2096,2129],{"__ignoreMap":814},[818,1803,1804,1806,1809,1811,1814,1816,1818,1820,1822,1824,1826,1828,1830,1832,1834,1836,1839,1841,1843,1845,1847,1849,1851,1853,1855,1857,1860,1862,1864],{"class":820,"line":821},[818,1805,1153],{"class":824},[818,1807,1808],{"class":876}," Order",[818,1810,976],{"class":832},[818,1812,1813],{"class":927}," id",[818,1815,873],{"class":832},[818,1817,877],{"class":876},[818,1819,1168],{"class":832},[818,1821,1249],{"class":927},[818,1823,873],{"class":832},[818,1825,877],{"class":876},[818,1827,1168],{"class":832},[818,1829,1244],{"class":927},[818,1831,873],{"class":832},[818,1833,877],{"class":876},[818,1835,1168],{"class":832},[818,1837,1838],{"class":927}," priority",[818,1840,873],{"class":832},[818,1842,877],{"class":876},[818,1844,1168],{"class":832},[818,1846,836],{"class":832},[818,1848,1771],{"class":839},[818,1850,962],{"class":832},[818,1852,873],{"class":832},[818,1854,877],{"class":876},[818,1856,1168],{"class":832},[818,1858,1859],{"class":927}," due_at",[818,1861,873],{"class":832},[818,1863,877],{"class":876},[818,1865,1212],{"class":832},[818,1867,1868],{"class":820,"line":846},[818,1869,850],{"emptyLinePlaceholder":849},[818,1871,1872,1874,1876,1879,1881,1883,1885,1887,1889,1892,1894,1897,1899,1902,1904,1907,1909],{"class":820,"line":853},[818,1873,856],{"class":824},[818,1875,859],{"class":824},[818,1877,1878],{"class":862}," openOrders",[818,1880,866],{"class":832},[818,1882,1408],{"class":869},[818,1884,873],{"class":832},[818,1886,877],{"class":876},[818,1888,880],{"class":832},[818,1890,1891],{"class":869}," page",[818,1893,917],{"class":832},[818,1895,1896],{"class":1282}," 0",[818,1898,880],{"class":832},[818,1900,1901],{"class":869}," pageSize",[818,1903,917],{"class":832},[818,1905,1906],{"class":1282}," 20",[818,1908,1029],{"class":832},[818,1910,905],{"class":832},[818,1912,1913,1915,1918,1920,1922,1925,1927],{"class":820,"line":908},[818,1914,911],{"class":824},[818,1916,1917],{"class":828}," query",[818,1919,917],{"class":832},[818,1921,1073],{"class":832},[818,1923,1924],{"class":862}," URLSearchParams",[818,1926,866],{"class":927},[818,1928,1929],{"class":832},"{\n",[818,1931,1932,1935,1937,1939,1942,1944],{"class":820,"line":949},[818,1933,1934],{"class":927},"    fields",[818,1936,873],{"class":832},[818,1938,836],{"class":832},[818,1940,1941],{"class":839},"id,number,status,priority,site.name,due_at",[818,1943,962],{"class":832},[818,1945,965],{"class":832},[818,1947,1948,1951,1954,1956,1958,1960,1963,1965],{"class":820,"line":968},[818,1949,1950],{"class":832},"    '",[818,1952,1953],{"class":927},"where[status][_in]",[818,1955,962],{"class":832},[818,1957,873],{"class":832},[818,1959,836],{"class":832},[818,1961,1962],{"class":839},"NEW,ASSIGNED,IN_PROGRESS",[818,1964,962],{"class":832},[818,1966,965],{"class":832},[818,1968,1969,1972,1974,1976,1979,1981],{"class":820,"line":998},[818,1970,1971],{"class":927},"    order_by",[818,1973,873],{"class":832},[818,1975,836],{"class":832},[818,1977,1978],{"class":839},"due_at",[818,1980,962],{"class":832},[818,1982,965],{"class":832},[818,1984,1985,1988,1990,1993,1995,1998,2000],{"class":820,"line":1038},[818,1986,1987],{"class":927},"    limit",[818,1989,873],{"class":832},[818,1991,1992],{"class":862}," String",[818,1994,866],{"class":927},[818,1996,1997],{"class":828},"pageSize",[818,1999,1029],{"class":927},[818,2001,965],{"class":832},[818,2003,2004,2007,2009,2011,2013,2016,2019,2021,2023],{"class":820,"line":1047},[818,2005,2006],{"class":927},"    offset",[818,2008,873],{"class":832},[818,2010,1992],{"class":862},[818,2012,866],{"class":927},[818,2014,2015],{"class":828},"page",[818,2017,2018],{"class":832}," *",[818,2020,1901],{"class":828},[818,2022,1029],{"class":927},[818,2024,965],{"class":832},[818,2026,2027,2030,2032,2034,2037,2039],{"class":820,"line":1090},[818,2028,2029],{"class":927},"    count",[818,2031,873],{"class":832},[818,2033,836],{"class":832},[818,2035,2036],{"class":839},"true",[818,2038,962],{"class":832},[818,2040,965],{"class":832},[818,2042,2043,2045],{"class":820,"line":1121},[818,2044,1041],{"class":832},[818,2046,1044],{"class":927},[818,2048,2049,2051,2053,2055,2057,2059,2061,2063,2065,2067,2069,2072,2074,2076,2078,2080,2082,2084,2087,2089,2092,2094],{"class":820,"line":1516},[818,2050,911],{"class":824},[818,2052,976],{"class":832},[818,2054,1444],{"class":828},[818,2056,880],{"class":832},[818,2058,1454],{"class":828},[818,2060,1026],{"class":832},[818,2062,917],{"class":832},[818,2064,921],{"class":920},[818,2066,1397],{"class":862},[818,2068,896],{"class":832},[818,2070,2071],{"class":876},"Order",[818,2073,1264],{"class":927},[818,2075,902],{"class":832},[818,2077,866],{"class":927},[818,2079,1408],{"class":828},[818,2081,880],{"class":832},[818,2083,1298],{"class":832},[818,2085,2086],{"class":839},"\u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders?",[818,2088,1304],{"class":832},[818,2090,2091],{"class":828},"query",[818,2093,1310],{"class":832},[818,2095,1044],{"class":927},[818,2097,2098,2100,2102,2105,2107,2109,2111,2114,2116,2118,2120,2123,2125,2127],{"class":820,"line":1527},[818,2099,1093],{"class":920},[818,2101,976],{"class":832},[818,2103,2104],{"class":927}," orders",[818,2106,873],{"class":832},[818,2108,1444],{"class":828},[818,2110,880],{"class":832},[818,2112,2113],{"class":927}," total",[818,2115,873],{"class":832},[818,2117,1454],{"class":828},[818,2119,1289],{"class":832},[818,2121,2122],{"class":828},"count",[818,2124,1622],{"class":920},[818,2126,1249],{"class":876},[818,2128,1212],{"class":832},[818,2130,2131],{"class":820,"line":1582},[818,2132,1124],{"class":832},[780,2134,2135,2136,2139,2140,2143],{},"Your roles decide what comes back. A row filter narrows the rows (a technician sees only their orders); a column without a field grant makes the request ",[784,2137,2138],{},"403 FIELD_PERMISSION_DENIED",", so ask only for columns your role may read. ",[801,2141,2142],{"href":637},"Docs › OpenAPI"," lists exactly those, for your roles.",[789,2145,2147],{"id":2146},"_4-create","4. Create",[780,2149,2150,2152,2153,2156,2157,2160,2161,2164,2165,2167,2168,807],{},[784,2151,959],{}," with ",[784,2154,2155],{},"{ \"data\": {...} }"," answers ",[784,2158,2159],{},"201"," with the row as PostgreSQL stored it, so defaults and values set by triggers (",[784,2162,2163],{},"number",", ",[784,2166,1978],{},") come back too. See ",[801,2169,620],{"href":621},[809,2171,2173],{"className":811,"code":2172,"language":813,"meta":814,"style":814},"async function reportOrder(token: string, site: string, branch: string, description: string) {\n  const { data } = await api\u003COrder>(token, '\u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders', {\n    method: 'POST',\n    body: JSON.stringify({ data: { type: 'REPAIR', priority: 'NORMAL', site, branch, description } }),\n  })\n  return data \u002F\u002F data.number is \"WO-000413\", set by the database\n}\n",[784,2174,2175,2223,2262,2276,2343,2349,2358],{"__ignoreMap":814},[818,2176,2177,2179,2181,2184,2186,2188,2190,2192,2194,2197,2199,2201,2203,2206,2208,2210,2212,2215,2217,2219,2221],{"class":820,"line":821},[818,2178,856],{"class":824},[818,2180,859],{"class":824},[818,2182,2183],{"class":862}," reportOrder",[818,2185,866],{"class":832},[818,2187,1408],{"class":869},[818,2189,873],{"class":832},[818,2191,877],{"class":876},[818,2193,880],{"class":832},[818,2195,2196],{"class":869}," site",[818,2198,873],{"class":832},[818,2200,877],{"class":876},[818,2202,880],{"class":832},[818,2204,2205],{"class":869}," branch",[818,2207,873],{"class":832},[818,2209,877],{"class":876},[818,2211,880],{"class":832},[818,2213,2214],{"class":869}," description",[818,2216,873],{"class":832},[818,2218,877],{"class":876},[818,2220,1029],{"class":832},[818,2222,905],{"class":832},[818,2224,2225,2227,2229,2231,2233,2235,2237,2239,2241,2243,2245,2247,2249,2251,2253,2256,2258,2260],{"class":820,"line":846},[818,2226,911],{"class":824},[818,2228,976],{"class":832},[818,2230,1444],{"class":828},[818,2232,1026],{"class":832},[818,2234,917],{"class":832},[818,2236,921],{"class":920},[818,2238,1397],{"class":862},[818,2240,896],{"class":832},[818,2242,2071],{"class":876},[818,2244,902],{"class":832},[818,2246,866],{"class":927},[818,2248,1408],{"class":828},[818,2250,880],{"class":832},[818,2252,836],{"class":832},[818,2254,2255],{"class":839},"\u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders",[818,2257,962],{"class":832},[818,2259,880],{"class":832},[818,2261,905],{"class":832},[818,2263,2264,2266,2268,2270,2272,2274],{"class":820,"line":853},[818,2265,952],{"class":927},[818,2267,873],{"class":832},[818,2269,836],{"class":832},[818,2271,959],{"class":839},[818,2273,962],{"class":832},[818,2275,965],{"class":832},[818,2277,2278,2280,2282,2284,2286,2288,2290,2292,2294,2296,2298,2301,2303,2305,2308,2310,2312,2314,2316,2318,2321,2323,2325,2327,2329,2331,2333,2335,2337,2339,2341],{"class":820,"line":908},[818,2279,1001],{"class":927},[818,2281,873],{"class":832},[818,2283,1006],{"class":828},[818,2285,807],{"class":832},[818,2287,1011],{"class":862},[818,2289,866],{"class":927},[818,2291,1016],{"class":832},[818,2293,1444],{"class":927},[818,2295,873],{"class":832},[818,2297,976],{"class":832},[818,2299,2300],{"class":927}," type",[818,2302,873],{"class":832},[818,2304,836],{"class":832},[818,2306,2307],{"class":839},"REPAIR",[818,2309,962],{"class":832},[818,2311,880],{"class":832},[818,2313,1838],{"class":927},[818,2315,873],{"class":832},[818,2317,836],{"class":832},[818,2319,2320],{"class":839},"NORMAL",[818,2322,962],{"class":832},[818,2324,880],{"class":832},[818,2326,2196],{"class":828},[818,2328,880],{"class":832},[818,2330,2205],{"class":828},[818,2332,880],{"class":832},[818,2334,2214],{"class":828},[818,2336,1026],{"class":832},[818,2338,1026],{"class":832},[818,2340,1029],{"class":927},[818,2342,965],{"class":832},[818,2344,2345,2347],{"class":820,"line":949},[818,2346,1041],{"class":832},[818,2348,1044],{"class":927},[818,2350,2351,2353,2355],{"class":820,"line":968},[818,2352,1093],{"class":920},[818,2354,1444],{"class":828},[818,2356,2357],{"class":1034}," \u002F\u002F data.number is \"WO-000413\", set by the database\n",[818,2359,2360],{"class":820,"line":998},[818,2361,1124],{"class":832},[780,2363,2364,2365,2368,2369,807],{},"To create a row with its children in one request (an order with its parts), see ",[801,2366,2367],{"href":625},"Nested writes",". For several tables in one transaction, see ",[801,2370,628],{"href":629},[789,2372,2374],{"id":2373},"_5-update-without-overwriting-someone-elses-change","5. Update without overwriting someone else's change",[780,2376,2377,2378,2381,2382,2385,2386,2389,2390,807],{},"Read the row by key: its ",[784,2379,2380],{},"ETag"," is the row's version. Send it back in ",[784,2383,2384],{},"If-Match",", and if someone changed the row in between, the update answers ",[784,2387,2388],{},"409 ROW_VERSION_CONFLICT"," instead of overwriting it. See ",[801,2391,2393],{"href":2392},"\u002Fdata-api\u002Fwriting#optimistic-writes","Optimistic writes",[809,2395,2397],{"className":811,"code":2396,"language":813,"meta":814,"style":814},"async function assign(token: string, id: string, technician: string) {\n  const { etag } = await api\u003COrder>(token, `\u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders\u002F${id}`)\n  const { data } = await api\u003COrder>(token, `\u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders\u002F${id}`, {\n    method: 'PATCH',\n    headers: { 'if-match': etag! },\n    body: JSON.stringify({ data: { status: 'ASSIGNED', technician } }),\n  })\n  return data\n}\n",[784,2398,2399,2437,2479,2521,2536,2559,2604,2610,2617],{"__ignoreMap":814},[818,2400,2401,2403,2405,2408,2410,2412,2414,2416,2418,2420,2422,2424,2426,2429,2431,2433,2435],{"class":820,"line":821},[818,2402,856],{"class":824},[818,2404,859],{"class":824},[818,2406,2407],{"class":862}," assign",[818,2409,866],{"class":832},[818,2411,1408],{"class":869},[818,2413,873],{"class":832},[818,2415,877],{"class":876},[818,2417,880],{"class":832},[818,2419,1813],{"class":869},[818,2421,873],{"class":832},[818,2423,877],{"class":876},[818,2425,880],{"class":832},[818,2427,2428],{"class":869}," technician",[818,2430,873],{"class":832},[818,2432,877],{"class":876},[818,2434,1029],{"class":832},[818,2436,905],{"class":832},[818,2438,2439,2441,2443,2445,2447,2449,2451,2453,2455,2457,2459,2461,2463,2465,2467,2470,2472,2475,2477],{"class":820,"line":846},[818,2440,911],{"class":824},[818,2442,976],{"class":832},[818,2444,1474],{"class":828},[818,2446,1026],{"class":832},[818,2448,917],{"class":832},[818,2450,921],{"class":920},[818,2452,1397],{"class":862},[818,2454,896],{"class":832},[818,2456,2071],{"class":876},[818,2458,902],{"class":832},[818,2460,866],{"class":927},[818,2462,1408],{"class":828},[818,2464,880],{"class":832},[818,2466,1298],{"class":832},[818,2468,2469],{"class":839},"\u002Fapi\u002Fpublic\u002Ftable\u002Fwork_orders\u002F",[818,2471,1304],{"class":832},[818,2473,2474],{"class":828},"id",[818,2476,1310],{"class":832},[818,2478,1044],{"class":927},[818,2480,2481,2483,2485,2487,2489,2491,2493,2495,2497,2499,2501,2503,2505,2507,2509,2511,2513,2515,2517,2519],{"class":820,"line":853},[818,2482,911],{"class":824},[818,2484,976],{"class":832},[818,2486,1444],{"class":828},[818,2488,1026],{"class":832},[818,2490,917],{"class":832},[818,2492,921],{"class":920},[818,2494,1397],{"class":862},[818,2496,896],{"class":832},[818,2498,2071],{"class":876},[818,2500,902],{"class":832},[818,2502,866],{"class":927},[818,2504,1408],{"class":828},[818,2506,880],{"class":832},[818,2508,1298],{"class":832},[818,2510,2469],{"class":839},[818,2512,1304],{"class":832},[818,2514,2474],{"class":828},[818,2516,1310],{"class":832},[818,2518,880],{"class":832},[818,2520,905],{"class":832},[818,2522,2523,2525,2527,2529,2532,2534],{"class":820,"line":908},[818,2524,952],{"class":927},[818,2526,873],{"class":832},[818,2528,836],{"class":832},[818,2530,2531],{"class":839},"PATCH",[818,2533,962],{"class":832},[818,2535,965],{"class":832},[818,2537,2538,2540,2542,2544,2546,2549,2551,2553,2555,2557],{"class":820,"line":949},[818,2539,971],{"class":927},[818,2541,873],{"class":832},[818,2543,976],{"class":832},[818,2545,836],{"class":832},[818,2547,2548],{"class":927},"if-match",[818,2550,962],{"class":832},[818,2552,873],{"class":832},[818,2554,1474],{"class":828},[818,2556,1056],{"class":832},[818,2558,995],{"class":832},[818,2560,2561,2563,2565,2567,2569,2571,2573,2575,2577,2579,2581,2583,2585,2587,2590,2592,2594,2596,2598,2600,2602],{"class":820,"line":968},[818,2562,1001],{"class":927},[818,2564,873],{"class":832},[818,2566,1006],{"class":828},[818,2568,807],{"class":832},[818,2570,1011],{"class":862},[818,2572,866],{"class":927},[818,2574,1016],{"class":832},[818,2576,1444],{"class":927},[818,2578,873],{"class":832},[818,2580,976],{"class":832},[818,2582,1244],{"class":927},[818,2584,873],{"class":832},[818,2586,836],{"class":832},[818,2588,2589],{"class":839},"ASSIGNED",[818,2591,962],{"class":832},[818,2593,880],{"class":832},[818,2595,2428],{"class":828},[818,2597,1026],{"class":832},[818,2599,1026],{"class":832},[818,2601,1029],{"class":927},[818,2603,965],{"class":832},[818,2605,2606,2608],{"class":820,"line":998},[818,2607,1041],{"class":832},[818,2609,1044],{"class":927},[818,2611,2612,2614],{"class":820,"line":1038},[818,2613,1093],{"class":920},[818,2615,2616],{"class":828}," data\n",[818,2618,2619],{"class":820,"line":1047},[818,2620,1124],{"class":832},[789,2622,2624],{"id":2623},"_6-handle-errors-by-their-code","6. Handle errors by their code",[780,2626,2627,2628,2630,2631,2633,2634,807],{},"Branch on ",[784,2629,784],{},", never on the message: codes are stable. The message is written for a person. A constraint's message is its author's own words, and ",[784,2632,1378],{}," names the column, so a form can show it beside the field. See ",[801,2635,758],{"href":759},[809,2637,2639],{"className":811,"code":2638,"language":813,"meta":814,"style":814},"try {\n  await assign(token, id, technician)\n} catch (error) {\n  if (!(error instanceof DataApiError)) throw error\n  switch (error.code) {\n    case 'ROW_VERSION_CONFLICT': \u002F* reload the row and show the newer values *\u002F break\n    case 'CHECK_VIOLATION':\n    case 'NOT_NULL_VIOLATION':\n    case 'UNIQUE_VIOLATION': \u002F* show error.message under error.field *\u002F break\n    case 'ACTION_DENIED': \u002F* \"No UPDATE grant on public.work_orders for your roles.\" - hide the action *\u002F break\n    case 'AUTHENTICATION_REQUIRED':\n    case 'SESSION_EXPIRED': \u002F* sign in again *\u002F break\n    case 'RATE_LIMIT_EXCEEDED': \u002F* wait the Retry-After header's seconds *\u002F break\n    default: throw error\n  }\n}\n",[784,2640,2641,2648,2669,2681,2707,2724,2744,2758,2771,2789,2807,2820,2838,2856,2868,2873],{"__ignoreMap":814},[818,2642,2643,2646],{"class":820,"line":821},[818,2644,2645],{"class":920},"try",[818,2647,905],{"class":832},[818,2649,2650,2653,2655,2657,2659,2661,2663,2665,2667],{"class":820,"line":846},[818,2651,2652],{"class":920},"  await",[818,2654,2407],{"class":862},[818,2656,866],{"class":927},[818,2658,1408],{"class":828},[818,2660,880],{"class":832},[818,2662,1813],{"class":828},[818,2664,880],{"class":832},[818,2666,2428],{"class":828},[818,2668,1044],{"class":927},[818,2670,2671,2673,2676,2679],{"class":820,"line":853},[818,2672,936],{"class":832},[818,2674,2675],{"class":920}," catch",[818,2677,2678],{"class":828}," (error) ",[818,2680,1929],{"class":832},[818,2682,2683,2685,2687,2689,2691,2694,2697,2699,2702,2704],{"class":820,"line":908},[818,2684,1050],{"class":920},[818,2686,1053],{"class":927},[818,2688,1056],{"class":832},[818,2690,866],{"class":927},[818,2692,2693],{"class":828},"error",[818,2695,2696],{"class":832}," instanceof",[818,2698,1224],{"class":876},[818,2700,2701],{"class":927},")) ",[818,2703,1070],{"class":920},[818,2705,2706],{"class":828}," error\n",[818,2708,2709,2712,2714,2716,2718,2720,2722],{"class":820,"line":949},[818,2710,2711],{"class":920},"  switch",[818,2713,1053],{"class":927},[818,2715,2693],{"class":828},[818,2717,807],{"class":832},[818,2719,784],{"class":828},[818,2721,1067],{"class":927},[818,2723,1929],{"class":832},[818,2725,2726,2729,2731,2734,2736,2738,2741],{"class":820,"line":968},[818,2727,2728],{"class":920},"    case",[818,2730,836],{"class":832},[818,2732,2733],{"class":839},"ROW_VERSION_CONFLICT",[818,2735,962],{"class":832},[818,2737,873],{"class":832},[818,2739,2740],{"class":1034}," \u002F* reload the row and show the newer values *\u002F",[818,2742,2743],{"class":920}," break\n",[818,2745,2746,2748,2750,2753,2755],{"class":820,"line":998},[818,2747,2728],{"class":920},[818,2749,836],{"class":832},[818,2751,2752],{"class":839},"CHECK_VIOLATION",[818,2754,962],{"class":832},[818,2756,2757],{"class":832},":\n",[818,2759,2760,2762,2764,2767,2769],{"class":820,"line":1038},[818,2761,2728],{"class":920},[818,2763,836],{"class":832},[818,2765,2766],{"class":839},"NOT_NULL_VIOLATION",[818,2768,962],{"class":832},[818,2770,2757],{"class":832},[818,2772,2773,2775,2777,2780,2782,2784,2787],{"class":820,"line":1047},[818,2774,2728],{"class":920},[818,2776,836],{"class":832},[818,2778,2779],{"class":839},"UNIQUE_VIOLATION",[818,2781,962],{"class":832},[818,2783,873],{"class":832},[818,2785,2786],{"class":1034}," \u002F* show error.message under error.field *\u002F",[818,2788,2743],{"class":920},[818,2790,2791,2793,2795,2798,2800,2802,2805],{"class":820,"line":1090},[818,2792,2728],{"class":920},[818,2794,836],{"class":832},[818,2796,2797],{"class":839},"ACTION_DENIED",[818,2799,962],{"class":832},[818,2801,873],{"class":832},[818,2803,2804],{"class":1034}," \u002F* \"No UPDATE grant on public.work_orders for your roles.\" - hide the action *\u002F",[818,2806,2743],{"class":920},[818,2808,2809,2811,2813,2816,2818],{"class":820,"line":1121},[818,2810,2728],{"class":920},[818,2812,836],{"class":832},[818,2814,2815],{"class":839},"AUTHENTICATION_REQUIRED",[818,2817,962],{"class":832},[818,2819,2757],{"class":832},[818,2821,2822,2824,2826,2829,2831,2833,2836],{"class":820,"line":1516},[818,2823,2728],{"class":920},[818,2825,836],{"class":832},[818,2827,2828],{"class":839},"SESSION_EXPIRED",[818,2830,962],{"class":832},[818,2832,873],{"class":832},[818,2834,2835],{"class":1034}," \u002F* sign in again *\u002F",[818,2837,2743],{"class":920},[818,2839,2840,2842,2844,2847,2849,2851,2854],{"class":820,"line":1527},[818,2841,2728],{"class":920},[818,2843,836],{"class":832},[818,2845,2846],{"class":839},"RATE_LIMIT_EXCEEDED",[818,2848,962],{"class":832},[818,2850,873],{"class":832},[818,2852,2853],{"class":1034}," \u002F* wait the Retry-After header's seconds *\u002F",[818,2855,2743],{"class":920},[818,2857,2858,2861,2863,2866],{"class":820,"line":1582},[818,2859,2860],{"class":920},"    default",[818,2862,873],{"class":832},[818,2864,2865],{"class":920}," throw",[818,2867,2706],{"class":828},[818,2869,2870],{"class":820,"line":1589},[818,2871,2872],{"class":832},"  }\n",[818,2874,2875],{"class":820,"line":1629},[818,2876,1124],{"class":832},[789,2878,2880],{"id":2879},"_7-types-from-the-openapi-document","7. Types from the OpenAPI document",[780,2882,2883,2886,2887,2889],{},[784,2884,2885],{},"GET \u002Fapi\u002Fopenapi.json"," describes every table, view and function your roles reach, with their columns and types. A generator turns it into TypeScript types, so ",[784,2888,2071],{}," above comes from the database instead of being written by hand:",[809,2891,2895],{"className":2892,"code":2893,"language":2894,"meta":814,"style":814},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl -s https:\u002F\u002Fops.acme-field.example\u002Fapi\u002Fopenapi.json -H \"authorization: Bearer $TOKEN\" > openapi.json\nnpx openapi-typescript openapi.json -o data-api.d.ts\n","bash",[784,2896,2897,2929],{"__ignoreMap":814},[818,2898,2899,2902,2905,2908,2911,2914,2917,2920,2923,2926],{"class":820,"line":821},[818,2900,2901],{"class":876},"curl",[818,2903,2904],{"class":839}," -s",[818,2906,2907],{"class":839}," https:\u002F\u002Fops.acme-field.example\u002Fapi\u002Fopenapi.json",[818,2909,2910],{"class":839}," -H",[818,2912,2913],{"class":832}," \"",[818,2915,2916],{"class":839},"authorization: Bearer ",[818,2918,2919],{"class":828},"$TOKEN",[818,2921,2922],{"class":832},"\"",[818,2924,2925],{"class":832}," >",[818,2927,2928],{"class":839}," openapi.json\n",[818,2930,2931,2934,2937,2940,2943],{"class":820,"line":846},[818,2932,2933],{"class":876},"npx",[818,2935,2936],{"class":839}," openapi-typescript",[818,2938,2939],{"class":839}," openapi.json",[818,2941,2942],{"class":839}," -o",[818,2944,2945],{"class":839}," data-api.d.ts\n",[780,2947,2948,2949,807],{},"The document follows your permissions and changes when the schema or a grant changes, so regenerate it after a change. See ",[801,2950,636],{"href":637},[789,2952,2954],{"id":2953},"next-steps","Next steps",[2956,2957,2958,2964,2969],"ul",{},[2959,2960,2961,2963],"li",{},[801,2962,612],{"href":613},": every operator, relative dates and periods.",[2959,2965,2966,2968],{},[801,2967,616],{"href":617},": totals and groups for a dashboard of your own.",[2959,2970,2971,2974],{},[801,2972,2973],{"href":633},"Calling functions",": business logic that runs in PostgreSQL.",[2976,2977,2978],"style",{},"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 .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 .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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":814,"searchDepth":821,"depth":846,"links":2980},[2981,2982,2983,2984,2985,2986,2987,2988],{"id":791,"depth":846,"text":792},{"id":1127,"depth":846,"text":1128},{"id":1761,"depth":846,"text":1762},{"id":2146,"depth":846,"text":2147},{"id":2373,"depth":846,"text":2374},{"id":2623,"depth":846,"text":2624},{"id":2879,"depth":846,"text":2880},{"id":2953,"depth":846,"text":2954},"A small TypeScript client for the Data API: sign in, list with filters and relations, page, create, update safely, and handle errors.","md",{},{"title":644,"description":2989},"I-GPD0MgmrP1rGRqXI2Tsp224eoggf4-PMufu0bZWqY",[2995,2997],{"title":640,"path":641,"stem":642,"description":2996,"children":-1},"Every Data API route on one page: the patterns over your tables, views and functions, and the fixed routes.",{"title":189,"path":653,"stem":654,"description":2998,"children":-1},"The instance itself: its address and name, appearance, the database connection, maintenance and email.",1792339954898]