-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
259 additions
and
6,972 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# yaml-language-server: $schema=https://unpkg.com/undocs/schema/config.json | ||
|
||
name: "db0" | ||
shortDescription: "elegant Database API" | ||
description: "" | ||
github: "unjs/db0" | ||
url: "https://db0.unjs.io" | ||
automd: true | ||
themeColor: "orange" | ||
# landing: | ||
# contributors: true | ||
# heroLinks: | ||
# stackblitz: | ||
# icon: "i-heroicons-play" | ||
# to: "https://stackblitz.com/github/unjs/packageName/tree/main/playground" | ||
# features: | ||
# - title: | ||
# description: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,12 +1,4 @@ | ||
node_modules | ||
*.iml | ||
.idea | ||
*.log* | ||
.nuxt | ||
.vscode | ||
.DS_Store | ||
coverage | ||
dist | ||
sw.* | ||
.env | ||
.output | ||
dist |
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
--- | ||
icon: material-symbols:http | ||
--- | ||
|
||
# HTTP Server | ||
|
||
> Expose SQL databases over (secure) HTTP as a restfu API for edge runtimes! | ||
> [!NOTE] | ||
> 🚀 This feature is planned! Follow up [unjs/db0#6](https://github.com/unjs/db0/issues/6) |
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,14 @@ | ||
--- | ||
icon: material-symbols-light:dashboard-customize | ||
--- | ||
|
||
# Custom Connectors | ||
|
||
If there is no built-in connector yet for a SQL database integration, you can create a custom one by yourself. | ||
|
||
::read-more{to="https://github.com/unjs/db0/tree/main/src/connectors"} | ||
Explore [built-in connectors](https://github.com/unjs/db0/tree/main/src/connectors) to learn how to implement a custom connector. | ||
:: | ||
|
||
> [!NOTE] | ||
> Feel free to [request new a new connector](https://github.com/unjs/db0/issues/new?assignees=&labels=connector&projects=&template=feature-request.yml). |
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,9 @@ | ||
--- | ||
icon: gravity-ui:plug-connection | ||
--- | ||
|
||
# Connectors | ||
|
||
> You can use DB0 api with the connector of your own choice. | ||
See left sections for each connector instructions. |
13 changes: 10 additions & 3 deletions
13
docs/content/100.connectors/cloudflare-d1.md → docs/2.connectors/cloudflare.md
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
32 changes: 10 additions & 22 deletions
32
docs/content/100.connectors/libsql.md → docs/2.connectors/libsql.md
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,27 @@ | ||
--- | ||
icon: simple-icons:planetscale | ||
--- | ||
|
||
# PlanetScale | ||
|
||
> Connect DB0 to Planetscale | ||
:read-more{to="https://planetscale.com"} | ||
|
||
> [!WARNING] | ||
> 🚀 This connector will be supported soon! Follow up via [unjs/db0#4](https://github.com/unjs/db0/issues/4). | ||
## Usage | ||
|
||
Use `planetscale` connector: | ||
|
||
```js | ||
import { createDatabase, sql } from "db0"; | ||
import planetscale from "db0/connectors/planetscale"; | ||
|
||
const db = createDatabase( | ||
planetscale({ | ||
/* options */ | ||
}), | ||
); | ||
``` |
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,38 @@ | ||
--- | ||
icon: simple-icons:postgresql | ||
--- | ||
|
||
# PostgreSQL | ||
|
||
> Connect DB0 to PostgreSQL | ||
:read-more{to="https://www.postgresql.org"} | ||
|
||
## Usage | ||
|
||
For this connector, you need to install [`pg`](https://www.npmjs.com/package/pg) dependency: | ||
|
||
:pm-install{name="pg@8 @types/pg@8"} | ||
|
||
Use `postgresql` connector: | ||
|
||
```js | ||
import { createDatabase, sql } from "db0"; | ||
import postgresql from "db0/connectors/postgresql"; | ||
|
||
const db = createDatabase( | ||
postgresql({ | ||
bindingName: "DB", | ||
}), | ||
); | ||
``` | ||
|
||
## Options | ||
|
||
### `url` | ||
|
||
Connection URL string. | ||
|
||
Alternatively, you can add connection configuration. | ||
|
||
:read-more{title="node-postgres client options" to="https://node-postgres.com/apis/client#new-client"} |
24 changes: 8 additions & 16 deletions
24
docs/content/100.connectors/sqlite.md → docs/2.connectors/sqlite.md
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,25 @@ | ||
--- | ||
icon: simple-icons:turso | ||
--- | ||
|
||
# Turso | ||
|
||
> Connect DB0 to Turso database | ||
:read-more{to="https://turso.tech"} | ||
|
||
> [!WARNING] | ||
> 🚀 This connector will be supported soon! Follow up via [unjs/db0#11](https://github.com/unjs/db0/issues/11). | ||
Use ~~`turso`~~ connector: | ||
|
||
```js | ||
import { createDatabase, sql } from "db0"; | ||
import vercelPostgres from "db0/connectors/turso"; | ||
|
||
const db = createDatabase( | ||
turso({ | ||
/* options */ | ||
}), | ||
); | ||
``` |
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,27 @@ | ||
--- | ||
icon: radix-icons:vercel-logo | ||
--- | ||
|
||
# Vercel | ||
|
||
Connect to [Vercel Postgres](https://vercel.com/docs/storage/vercel-postgres) database. | ||
|
||
:read-more{to="https://vercel.com/docs/storage/vercel-postgres"} | ||
|
||
> [!WARNING] | ||
> 🚀 This connector will be supported soon! Follow up via [unjs/db0#3](https://github.com/unjs/db0/issues/3). In the meantime you can directly use [PostgreSQL connector](/connectors/postgresql). | ||
## Usage | ||
|
||
Use [`postgress`](/connectors/postgresql) connector. | ||
|
||
```js | ||
import { createDatabase, sql } from "db0"; | ||
import postgres from "db0/connectors/postgres"; | ||
|
||
const db = createDatabase( | ||
postgres({ | ||
/* options */ | ||
}), | ||
); | ||
``` |
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,9 @@ | ||
--- | ||
icon: carbon:property-relationship | ||
--- | ||
|
||
# Integrations | ||
|
||
> You can integrate DB0 instance to ORM or framework of your choice. | ||
See left sections for each integration instructions. |
Oops, something went wrong.