PageSourceSearch

https://kysely.dev/assets/js/f8409a7e.18190390.js

js kysely.dev collected 2026-10-02 02:58:32 UTC 4,226 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkkysely_site=globalThis.webpackChunkkysely_site||[]).push([[6903],{4155(e,t,s){s.r(t),s.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>n,toc:()=>d});const n=JSON.parse('{"id":"intro","title":"Introduction","description":"Meet Kysely, a TypeScript SQL query builder with compile-time type safety, autocompletion, and inferred result types for joins and subqueries.","source":"@site/docs/intro.mdx","sourceDirName":".","slug":"/intro","permalink":"/docs/intro","draft":false,"unlisted":false,"editUrl":"https://github.com/kysely-org/kysely/tree/master/site/docs/intro.mdx","tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"sidebar_position":1,"description":"Meet Kysely, a TypeScript SQL query builder with compile-time type safety, autocompletion, and inferred result types for joins and subqueries."},"sidebar":"tutorialSidebar","next":{"title":"Getting started","permalink":"/docs/getting-started"}}');var i=s(1058),o=s(4801);const r={sidebar_position:1,description:"Meet Kysely, a TypeScript SQL query builder with compile-time type safety, autocompletion, and inferred result types for joins and subqueries."},a="Introduction",l={},d=[{value:"Looking for help?",id:"looking-for-help",level:2}];function c(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"introduction",children:"Introduction"})}),"\n",(0,i.jsxs)(t.p,{children:["Kysely (pronounced \u201cKey-Seh-Lee\u201d) is a type-safe and autocompletion-friendly TypeScript SQL query builder. Inspired by Knex. Mainly developed for ",(0,i.jsx)(t.a,{href:"https://nodejs.org/en/",children:"node.js"})," but also\nruns on all other JavaScript environments like ",(0,i.jsx)(t.a,{href:"https://deno.land/",children:"deno"})," and ",(0,i.jsx)(t.a,{href:"https://bun.sh/",children:"bun"}),"."]}),"\n",(0,i.jsx)(t.p,{children:"Kysely makes sure you only refer to tables and columns that are visible to the part of the query you're writing. The result type only has the selected columns with correct types and aliases. As an added bonus you get autocompletion for all that stuff."}),"\n",(0,i.jsxs)(t.p,{children:["Through the pure magic of modern TypeScript, Kysely is even able to parse the alias given to ",(0,i.jsx)(t.code,{children:"pet.name"})," and add the ",(0,i.jsx)(t.code,{children:"pet_name"})," column to the result row type. Kysely is able to infer column names, aliases and types from selected subqueries, joined subqueries, ",(0,i.jsx)(t.code,{children:"with"})," statements and pretty much anything you can think of."]}),"\n",(0,i.jsxs)(t.p,{children:["Of course there are cases where things cannot be typed at compile time, and Kysely offers escape hatches for these situations. See the ",(0,i.jsx)(t.a,{href:"https://kysely-org.github.io/kysely-apidoc/interfaces/Sql.html",children:"sql template tag"})," and the ",(0,i.jsx)(t.a,{href:"https://kysely-org.github.io/kysely-apidoc/classes/DynamicModule.html#ref",children:"DynamicModule"})," for more info."]}),"\n",(0,i.jsxs)(t.p,{children:["All API documentation is written in the typing files and you can simply hover over the module, class or method you're using to see it in your IDE. The same documentation is also available in the ",(0,i.jsx)(t.a,{href:"https://kysely-org.github.io/kysely-apidoc/",children:"Kysely API reference"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["If you start using Kysely and can't find something you'd want to use, please open an issue or join our ",(0,i.jsx)(t.a,{href:"https://discord.gg/xyBJ3GwvAm",children:"Discord server"}),"."]}),"\n",(0,i.jsx)(t.h2,{id:"looking-for-help",children:"Looking for help?"}),"\n",(0,i.jsxs)(t.p,{children:["If you start using Kysely and can't find something you'd want to use, please ",(0,i.jsx)(t.a,{href:"https://github.com/kysely-org/kysely/issues",children:"open an issue"})," or ",(0,i.jsx)(t.a,{href:"https://discord.gg/xyBJ3GwvAm",children:"join our Discord server"}),"."]})]})}function h(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(c,{...e})}):c(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.