Skip to content

Commit

Permalink
docs: mention SQLite ParseJSONResultsPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jlarmstrongiv committed Jul 15, 2023
1 parent 9b5f8b0 commit 5d53ac4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion site/docs/recipes/relations.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ In this recipe we show one way to do that when using the built-in PostgreSQL, My

## The `json` data type and functions

PostgreSQL, MySQL, and SQLite have rich JSON support through their `json` data types and functions. `pg` and `mysql2`, the node drivers, automatically parse returned `json` columns as json objects. With the combination of these two things, we can write some super efficient queries with nested relations.
PostgreSQL and MySQL have rich JSON support through their `json` data types and functions. `pg` and `mysql2`, the node drivers, automatically parse returned `json` columns as json objects. With the combination of these two things, we can write some super efficient queries with nested relations.

With the `ParseJSONResultsPlugin`, SQLite can also automatically parse results:

```ts
db = db.withPlugin(new ParseJSONResultsPlugin())
```

Let's start with some raw postgres SQL, and then see how we can write the query using Kysely in a nice type-safe way.

Expand Down

0 comments on commit 5d53ac4

Please sign in to comment.