PageSourceSearch

https://kysely.dev/assets/js/25ba13d1.5c7e100c.js

js kysely.dev collected 2026-10-02 02:58:58 UTC 2,770 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkkysely_site=globalThis.webpackChunkkysely_site||[]).push([[9050],{82(e,t,s){s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>p,frontMatter:()=>c,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"examples/select/distinct-on","title":"Distinct on","description":"The API documentation is packed with examples. The API docs are hosted here,","source":"@site/docs/examples/select/0080-distinct-on.mdx","sourceDirName":"examples/select","slug":"/examples/select/distinct-on","permalink":"/docs/examples/select/distinct-on","draft":false,"unlisted":false,"editUrl":"https://github.com/kysely-org/kysely/tree/master/site/docs/examples/select/0080-distinct-on.mdx","tags":[],"version":"current","sidebarPosition":80,"frontMatter":{"title":"Distinct on"},"sidebar":"tutorialSidebar","previous":{"title":"Distinct","permalink":"/docs/examples/select/distinct"},"next":{"title":"All columns","permalink":"/docs/examples/select/all-columns"}}');var n=s(1058),l=s(4801),o=s(2360);const c={title:"Distinct on"},r="Distinct on",a={},d=[];function h(e){const t={a:"a",admonition:"admonition",h1:"h1",header:"header",li:"li",p:"p",ul:"ul",...(0,l.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.header,{children:(0,n.jsx)(t.h1,{id:"distinct-on",children:"Distinct on"})}),"\n","\n","\n",(0,n.jsx)("div",{style:{marginBottom:"1em"},children:(0,n.jsx)(o.Q,{code:"const persons = await db.selectFrom('person')\n  .innerJoin('pet', 'pet.owner_id', 'person.id')\n  .where('pet.name', '=', 'Doggo')\n  .distinctOn('person.id')\n  .selectAll('person')\n  .execute()"})}),"\n",(0,n.jsxs)(t.admonition,{title:"More examples",type:"info",children:[(0,n.jsxs)(t.p,{children:["The API documentation is packed with examples. The API docs are hosted ",(0,n.jsx)(t.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,n.jsx)(t.p,{children:"For example, check out these sections:"}),(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#select",children:"select method"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#selectAll",children:"selectAll method"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#selectFrom",children:"selectFrom method"})}),"\n"]})]})]})}function p(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.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.