1"use strict";(globalThis.webpackChunkkysely_site=globalThis.webpackChunkkysely_site||[]).push([[6985],{8691(e,s,t){t.r(s),t.d(s,{assets:()=>d,contentTitle:()=>o,default:()=>p,frontMatter:()=>a,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"examples/update/single-row","title":"Single row","description":"Update a row in person table:","source":"@site/docs/examples/update/0010-single-row.mdx","sourceDirName":"examples/update","slug":"/examples/update/single-row","permalink":"/docs/examples/update/single-row","draft":false,"unlisted":false,"editUrl":"https://github.com/kysely-org/kysely/tree/master/site/docs/examples/update/0010-single-row.mdx","tags":[],"version":"current","sidebarPosition":10,"frontMatter":{"title":"Single row"},"sidebar":"tutorialSidebar","previous":{"title":"UPDATE","permalink":"/docs/category/update"},"next":{"title":"Complex values","permalink":"/docs/examples/update/complex-values"}}');var i=t(1058),l=t(4801),r=t(2360);const a={title:"Single row"},o="Single row",d={},c=[];function h(e){const s={a:"a",admonition:"admonition",code:"code",h1:"h1",header:"header",li:"li",p:"p",ul:"ul",...(0,l.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.header,{children:(0,i.jsx)(s.h1,{id:"single-row",children:"Single row"})}),"\n",(0,i.jsxs)(s.p,{children:["Update a row in ",(0,i.jsx)(s.code,{children:"person"})," table:"]}),"\n","\n","\n",(0,i.jsx)("div",{style:{marginBottom:"1em"},children:(0,i.jsx)(r.Q,{code:"const result = await db\n .updateTable('person')\n .set({\n first_name: 'Jennifer',\n last_name: 'Aniston'\n })\n .where('id', '=', 1)\n .executeTakeFirst()"})}),"\n",(0,i.jsxs)(s.admonition,{title:"More examples",type:"info",children:[(0,i.jsxs)(s.p,{children:["The API documentation is packed with examples. The API docs are hosted ",(0,i.jsx)(s.a,{href:"https://kysely-org.github.io/kysely-apidoc/",children:"here"}),",\nbut you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always\njust one hover away!"]}),(0,i.jsx)(s.p,{children:"For example, check out these sections:"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"https://kysely-org.github.io/kysely-apidoc/classes/UpdateQueryBuilder.html#set",children:"set method"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"https://kysely-org.github.io/kysely-apidoc/classes/UpdateQueryBuilder.html#returning",children:"returning method"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.a,{href:"https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#updateTable",children:"updateTable method"})}),"\n"]})]})]})}function p(e={}){const{wrapper:s}={...(0,l.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.