-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORM docs and uuid-ossp extension docs
- Loading branch information
Showing
3 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# ORM Support | ||
|
||
## Drizzle | ||
|
||
[Drizzle](https://orm.drizzle.team) is a TypeScript ORM with support for many datbases include PGlite. Features include: | ||
|
||
- A declarative realtional query API | ||
- An SQL-like query builder API | ||
- Migrations | ||
|
||
To use PGlite with Drizzle just wrap you PGlite instance with a `drizzle()` call: | ||
|
||
```sh | ||
npm i drizzle-orm @electric-sql/pglite | ||
npm i -D drizzle-kit | ||
``` | ||
|
||
```ts | ||
import { PGlite } from '@electric-sql/pglite'; | ||
import { drizzle } from 'drizzle-orm/pglite'; | ||
|
||
const client = new PGlite(); | ||
const db = drizzle(client); | ||
|
||
await db.select().from(users); | ||
``` | ||
|
||
See the [Drizzle documentation](https://orm.drizzle.team/docs/get-started-postgresql#pglite) for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters