Skip to content

Commit

Permalink
chore: rename to db0
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed May 19, 2023
1 parent 3a45877 commit 61188b4
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
POSTGRESQL_URL=postgresql://<user>:@localhost:5432/sql0
POSTGRESQL_URL=postgresql://<user>:@localhost:5432/db0
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 💾 sql0
# db0

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
Expand All @@ -8,9 +8,9 @@

<!--[![Github Actions][github-actions-src]][github-actions-href]-->

sql0 provides an easy way to connect and query sql databases providers with a [tiny core](https://bundlephobia.com/package/sql0).
db0 provides an easy way to connect and query sql databases providers with a [tiny core](https://bundlephobia.com/package/db0).

<!-- 👉 [Documentation](https://sql0.unjs.io) -->
<!-- 👉 [Documentation](https://db0.unjs.io) -->

## Features

Expand All @@ -20,22 +20,22 @@ sql0 provides an easy way to connect and query sql databases providers with a [t

## Usage

Install `sql0` npm package:
Install `db0` npm package:

```sh
# yarn
yarn add sql0
yarn add db0

# npm
npm install sql0
npm install db0

# pnpm
pnpm add sql0
pnpm add db0
```

```js
import { createDB, sql } from "sql0";
import sqlite from "sql0/connectors/better-sqlite3";
import { createDB, sql } from "db0";
import sqlite from "db0/connectors/better-sqlite3";

const db = createDB(sqlite({}));

Expand All @@ -50,7 +50,7 @@ const row = await db.prepare("SELECT * FROM users WHERE id = ?").get(id);
console.log(row);
```

<!-- 👉 Check out the [the documentation](https://sql0.unjs.io) for usage information. -->
<!-- 👉 Check out the [the documentation](https://db0.unjs.io) for usage information. -->

## Contribution

Expand All @@ -65,15 +65,15 @@ console.log(row);

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/sql0?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/sql0
[npm-downloads-src]: https://img.shields.io/npm/dm/sql0?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/sql0
[github-actions-src]: https://img.shields.io/github/workflow/status/unjs/sql0/ci/main?style=flat&colorA=18181B&colorB=F0DB4F
[github-actions-href]: https://github.com/unjs/sql0/actions?query=workflow%3Aci
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/sql0/main?style=flat&colorA=18181B&colorB=F0DB4F
[codecov-href]: https://codecov.io/gh/unjs/sql0
[bundle-src]: https://img.shields.io/bundlephobia/minzip/sql0?style=flat&colorA=18181B&colorB=F0DB4F
[bundle-href]: https://bundlephobia.com/result?p=sql0
[license-src]: https://img.shields.io/github/license/unjs/sql0.svg?style=flat&colorA=18181B&colorB=F0DB4F
[license-href]: https://github.com/unjs/sql0/blob/main/LICENSE
[npm-version-src]: https://img.shields.io/npm/v/db0?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/db0
[npm-downloads-src]: https://img.shields.io/npm/dm/db0?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/db0
[github-actions-src]: https://img.shields.io/github/workflow/status/unjs/db0/ci/main?style=flat&colorA=18181B&colorB=F0DB4F
[github-actions-href]: https://github.com/unjs/db0/actions?query=workflow%3Aci
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/db0/main?style=flat&colorA=18181B&colorB=F0DB4F
[codecov-href]: https://codecov.io/gh/unjs/db0
[bundle-src]: https://img.shields.io/bundlephobia/minzip/db0?style=flat&colorA=18181B&colorB=F0DB4F
[bundle-href]: https://bundlephobia.com/result?p=db0
[license-src]: https://img.shields.io/github/license/unjs/db0.svg?style=flat&colorA=18181B&colorB=F0DB4F
[license-href]: https://github.com/unjs/db0/blob/main/LICENSE
4 changes: 2 additions & 2 deletions docs/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export default defineAppConfig({
docus: {
title: "SQL0",
title: "db0",
description: "Universal Storage Layer.",
header: {
logo: false,
},
socials: {
twitter: "unjsio",
github: "unjs/sql0",
github: "unjs/db0",
},
aside: {
level: 0,
Expand Down
2 changes: 1 addition & 1 deletion docs/content/1.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ navigation.title: Introduction

# Introduction

[unjs/sql0](https://github.com/unjs/sql0) provides an easy way to connect and query sql databases providers.
[unjs/db0](https://github.com/unjs/db0) provides an easy way to connect and query sql databases providers.

## Features

Expand Down
4 changes: 2 additions & 2 deletions docs/content/100.connectors/cloudflare-d1.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ navigation.title: Cloudflare D1
This connector works within cloudflare workers with D1 enabled. [Read More](https://developers.cloudflare.com/d1/)

```js
import { createDB, sql } from "sql0";
import cloudflareD1 from "sql0/connectors/cloudflare-d1";
import { createDB, sql } from "db0";
import cloudflareD1 from "db0/connectors/cloudflare-d1";

const db = createDB(
cloudflareD1({
Expand Down
6 changes: 3 additions & 3 deletions docs/content/100.connectors/libsql.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ navigation.title: LibSQL
Connect to [LibSQL](https://libsql.org/) database.

::alert{type="primary"}
🚀 This connector will be comming soon! Follow up via [unjs/sql0#14](https://github.com/unjs/sql0/issues/14).
🚀 This connector will be comming soon! Follow up via [unjs/db0#14](https://github.com/unjs/db0/issues/14).
::

```js
import { createDB, sql } from "sql0";
import vercelPostgres from "sql0/connectors/libsql";
import { createDB, sql } from "db0";
import vercelPostgres from "db0/connectors/libsql";

const db = createDB(
libsql({
Expand Down
6 changes: 3 additions & 3 deletions docs/content/100.connectors/planetscale.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ navigation.title: PlanetScale
Connect to [Planetscale](https://planetscale.com/) database.

::alert{type="primary"}
🚀 This connector will be comming soon! Follow up via [unjs/sql0#4](https://github.com/unjs/sql0/issues/4).
🚀 This connector will be comming soon! Follow up via [unjs/db0#4](https://github.com/unjs/db0/issues/4).
::

```js
import { createDB, sql } from "sql0";
import planetscale from "sql0/connectors/planetscale";
import { createDB, sql } from "db0";
import planetscale from "db0/connectors/planetscale";

const db = createDB(
planetscale({
Expand Down
4 changes: 2 additions & 2 deletions docs/content/100.connectors/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pnpm add pg@8 @types/pg@8
::

```js
import { createDB, sql } from "sql0";
import postgresql from "sql0/connectors/postgresql";
import { createDB, sql } from "db0";
import postgresql from "db0/connectors/postgresql";

const db = createDB(
postgresql({
Expand Down
4 changes: 2 additions & 2 deletions docs/content/100.connectors/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pnpm add better-sqlite3@8
::

```js
import { createDB, sql } from "sql0";
import sqlite from "sql0/connectors/better-sqlite3";
import { createDB, sql } from "db0";
import sqlite from "db0/connectors/better-sqlite3";

const db = createDB(
sqlite({
Expand Down
6 changes: 3 additions & 3 deletions docs/content/100.connectors/turso.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ navigation.title: Turso

# Turso Connector

Connect to [Turso](https://turso.tech/) database. Follow up via [unjs/sql0#11](https://github.com/unjs/sql0/issues/11).
Connect to [Turso](https://turso.tech/) database. Follow up via [unjs/db0#11](https://github.com/unjs/db0/issues/11).

::alert{type="primary"}
🚀 This connector will be comming soon!
::

```js
import { createDB, sql } from "sql0";
import vercelPostgres from "sql0/connectors/turso";
import { createDB, sql } from "db0";
import vercelPostgres from "db0/connectors/turso";

const db = createDB(
turso({
Expand Down
6 changes: 3 additions & 3 deletions docs/content/100.connectors/vercel-postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ navigation.title: Vecel Postgresql
Connect to [Vercel Postgres](https://vercel.com/docs/storage/vercel-postgres) database.

::alert{type="primary"}
🚀 This connector will be comming soon! Follow up via [unjs/sql0#3](https://github.com/unjs/sql0/issues/3).
🚀 This connector will be comming soon! Follow up via [unjs/db0#3](https://github.com/unjs/db0/issues/3).
::

```js
import { createDB, sql } from "sql0";
import vercelPostgres from "sql0/connectors/vercel-postgres";
import { createDB, sql } from "db0";
import vercelPostgres from "db0/connectors/vercel-postgres";

const db = createDB(
vercelPostgres({
Expand Down
14 changes: 7 additions & 7 deletions docs/content/2.usage.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Usage

Discover how to use `sql0` in your project.
Discover how to use `db0` in your project.

## Installation

Install [`sql0`](https://npmjs.com/package/sql0) npm package:
Install [`db0`](https://npmjs.com/package/db0) npm package:

::code-group

```sh [npm]
npm install sql0
npm install db0
```

```sh [Yarn]
yarn add sql0
yarn add db0
```

```sh [pnpm]
pnpm add sql0
pnpm add db0
```

::

## Usage

```ts
import { createDB, sql } from "sql0";
import sqlite from "sql0/connectors/better-sqlite3";
import { createDB, sql } from "db0";
import sqlite from "db0/connectors/better-sqlite3";

const db = createDB(sqlite({}));

Expand Down
2 changes: 1 addition & 1 deletion docs/content/3.http-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Expose SQL databases over (secure) HTTP as a restfu API for edge runtimes!

::alert{type="primary"}
🚀 This feature is planned! Follow up [unjs/sql0#6](https://github.com/unjs/sql0/issues/6)
🚀 This feature is planned! Follow up [unjs/db0#6](https://github.com/unjs/db0/issues/6)
::
4 changes: 2 additions & 2 deletions docs/content/4.custom-connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

If there is no built-in connector yet for a SQL database integration, you can create a custom one by yourself.

Explore [built-in connectors](https://github.com/unjs/sql0/tree/main/src/conectors) to learn how to implement a custom connector.
Explore [built-in connectors](https://github.com/unjs/db0/tree/main/src/conectors) to learn how to implement a custom connector.

Always feel free to open an issue to [request new connector](https://github.com/unjs/sql0/issues/new?assignees=&labels=connector&projects=&template=feature-request.yml).
Always feel free to open an issue to [request new connector](https://github.com/unjs/db0/issues/new?assignees=&labels=connector&projects=&template=feature-request.yml).
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "sql0",
"name": "db0",
"version": "0.1.0",
"description": "",
"repository": "unjs/sql0",
"repository": "unjs/db0",
"license": "MIT",
"sideEffects": false,
"exports": {
Expand Down Expand Up @@ -32,7 +32,7 @@
"prepack": "pnpm build",
"release": "pnpm test && changelogen --release --push && pnpm publish",
"test": "pnpm lint && vitest run --coverage",
"sql0": "pnpm jiti src/cli"
"db0": "pnpm jiti src/cli"
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.4",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ export * from "./db";
export * from "./types";

export const connectors = {
sqlite: "sql0/connectors/better-sqlite3",
postgresql: "sql0/connectors/postgresql",
sqlite: "db0/connectors/better-sqlite3",
postgresql: "db0/connectors/postgresql",
} as const;

export type ConnectorName = keyof typeof connectors;

0 comments on commit 61188b4

Please sign in to comment.