From 61188b493fad55649879a52837c9d35cebb3a12b Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 19 May 2023 13:51:31 +0200 Subject: [PATCH] chore: rename to `db0` --- .env.example | 2 +- README.md | 44 +++++++++---------- docs/app.config.ts | 4 +- docs/content/1.index.md | 2 +- docs/content/100.connectors/cloudflare-d1.md | 4 +- docs/content/100.connectors/libsql.md | 6 +-- docs/content/100.connectors/planetscale.md | 6 +-- docs/content/100.connectors/postgresql.md | 4 +- docs/content/100.connectors/sqlite.md | 4 +- docs/content/100.connectors/turso.md | 6 +-- .../100.connectors/vercel-postgresql.md | 6 +-- docs/content/2.usage.md | 14 +++--- docs/content/3.http-server.md | 2 +- docs/content/4.custom-connector.md | 4 +- package.json | 6 +-- src/index.ts | 4 +- 16 files changed, 59 insertions(+), 59 deletions(-) diff --git a/.env.example b/.env.example index a38feae..d4da5fe 100644 --- a/.env.example +++ b/.env.example @@ -1 +1 @@ -POSTGRESQL_URL=postgresql://:@localhost:5432/sql0 +POSTGRESQL_URL=postgresql://:@localhost:5432/db0 diff --git a/README.md b/README.md index 9bd007e..4fa8341 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 💾 sql0 +# db0 [![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] @@ -8,9 +8,9 @@ -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). - + ## Features @@ -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({})); @@ -50,7 +50,7 @@ const row = await db.prepare("SELECT * FROM users WHERE id = ?").get(id); console.log(row); ``` - + ## Contribution @@ -65,15 +65,15 @@ console.log(row); -[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 diff --git a/docs/app.config.ts b/docs/app.config.ts index fa513ee..0bfc897 100644 --- a/docs/app.config.ts +++ b/docs/app.config.ts @@ -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, diff --git a/docs/content/1.index.md b/docs/content/1.index.md index 961e12c..75cf136 100644 --- a/docs/content/1.index.md +++ b/docs/content/1.index.md @@ -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 diff --git a/docs/content/100.connectors/cloudflare-d1.md b/docs/content/100.connectors/cloudflare-d1.md index 757fefc..cc299e2 100644 --- a/docs/content/100.connectors/cloudflare-d1.md +++ b/docs/content/100.connectors/cloudflare-d1.md @@ -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({ diff --git a/docs/content/100.connectors/libsql.md b/docs/content/100.connectors/libsql.md index 9cc13e5..ab1e5f3 100644 --- a/docs/content/100.connectors/libsql.md +++ b/docs/content/100.connectors/libsql.md @@ -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({ diff --git a/docs/content/100.connectors/planetscale.md b/docs/content/100.connectors/planetscale.md index 6fc93fe..3c34364 100644 --- a/docs/content/100.connectors/planetscale.md +++ b/docs/content/100.connectors/planetscale.md @@ -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({ diff --git a/docs/content/100.connectors/postgresql.md b/docs/content/100.connectors/postgresql.md index e245c40..8e6faf0 100644 --- a/docs/content/100.connectors/postgresql.md +++ b/docs/content/100.connectors/postgresql.md @@ -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({ diff --git a/docs/content/100.connectors/sqlite.md b/docs/content/100.connectors/sqlite.md index f2d7857..d51e081 100644 --- a/docs/content/100.connectors/sqlite.md +++ b/docs/content/100.connectors/sqlite.md @@ -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({ diff --git a/docs/content/100.connectors/turso.md b/docs/content/100.connectors/turso.md index 9085212..11676cf 100644 --- a/docs/content/100.connectors/turso.md +++ b/docs/content/100.connectors/turso.md @@ -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({ diff --git a/docs/content/100.connectors/vercel-postgresql.md b/docs/content/100.connectors/vercel-postgresql.md index 6848ac4..058a97d 100644 --- a/docs/content/100.connectors/vercel-postgresql.md +++ b/docs/content/100.connectors/vercel-postgresql.md @@ -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({ diff --git a/docs/content/2.usage.md b/docs/content/2.usage.md index 5fe7b81..b5daf78 100644 --- a/docs/content/2.usage.md +++ b/docs/content/2.usage.md @@ -1,23 +1,23 @@ # 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 ``` :: @@ -25,8 +25,8 @@ pnpm add sql0 ## 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({})); diff --git a/docs/content/3.http-server.md b/docs/content/3.http-server.md index df0bf0c..3b539eb 100644 --- a/docs/content/3.http-server.md +++ b/docs/content/3.http-server.md @@ -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) :: diff --git a/docs/content/4.custom-connector.md b/docs/content/4.custom-connector.md index d10a7b0..62f7307 100644 --- a/docs/content/4.custom-connector.md +++ b/docs/content/4.custom-connector.md @@ -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). diff --git a/package.json b/package.json index a139e7c..46434b5 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "sql0", + "name": "db0", "version": "0.1.0", "description": "", - "repository": "unjs/sql0", + "repository": "unjs/db0", "license": "MIT", "sideEffects": false, "exports": { @@ -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", diff --git a/src/index.ts b/src/index.ts index a294409..5ba64cf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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;