Skip to content

Commit

Permalink
update outdated intro in kysely.dev
Browse files Browse the repository at this point in the history
  • Loading branch information
koskimas committed Mar 24, 2024
1 parent 9485b44 commit e84863d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions site/docs/intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ import { DemoVideo } from '@site/src/components/DemoVideo'

# Introduction

Kysely (pronounced “Key-Seh-Lee”) is a type-safe and autocompletion-friendly TypeScript SQL query builder. Inspired by Knex. Mainly developed for Node.js but also runs on Deno and in the browser.
Kysely (pronounced “Key-Seh-Lee”) is a type-safe and autocompletion-friendly TypeScript SQL query builder. Inspired by Knex. Mainly developed for [node.js](https://nodejs.org/en/) but also
runs on all other javascript environments like [deno](https://deno.land/) and [bun](https://bun.sh/).

<DemoVideo />

Kysely makes sure you only use 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.
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.

As shown above, through the magic of TypeScript, Kysely is able to parse the alias given to `pet.name` and add the `pet_name` column to the result row type. Kysely is able to infer column names, aliases and types from selected subqueries, joined subqueries, `with` statements and pretty much anything you can think of.
As shown in the gif above, through the pure magic of modern typescript, Kysely is even able to parse the alias given to `pet.name` and add the `pet_name` column to the result row type. Kysely is able to infer column names, aliases and types from selected subqueries, joined subqueries, `with` statements and pretty much anything you can think of.

Of course there are cases where things cannot be typed at compile time, and Kysely offers escape hatches for these situations. See the [sql](https://kysely-org.github.io/kysely-apidoc/interfaces/Sql.html) template tag and the [DynamicModule](https://kysely-org.github.io/kysely-apidoc/classes/DynamicModule.html) for more info.
Of course there are cases where things cannot be typed at compile time, and Kysely offers escape hatches for these situations. See the [sql template tag](https://kysely-org.github.io/kysely-apidoc/interfaces/Sql.html) and the [DynamicModule](https://kysely-org.github.io/kysely-apidoc/classes/DynamicModule.html#ref) for more info.

All API documentation is written in the typing files and you can simply cmd-click on the module, class or method you're using to see it. The same documentation is also hosted [here](https://kysely-org.github.io/kysely-apidoc).
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 hosted [here](https://kysely-org.github.io/kysely-apidoc/).

If you start using Kysely and can't find something you'd want to use, please open an issue or join our [discord server](https://discord.gg/xyBJ3GwvAm).

## Looking for help?

Expand Down

0 comments on commit e84863d

Please sign in to comment.