Skip to content

Commit

Permalink
Make drizzle-orm a peer dependency and update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
L-Mario564 committed Aug 22, 2024
1 parent f5c2145 commit 8f29063
Show file tree
Hide file tree
Showing 3 changed files with 1,323 additions and 1,085 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ Generate DBML markup from your schema defined with Drizzle ORM. Works with any d

## Generate DBML

To generate the DBML markup from your schema, all you have to do is run a script that executes the generate function of the dialect you're working with. To do that, you must install `ts-node`, and `drizzle-dbml-generator` of course.
To generate the DBML markup from your schema, all you have to do is run a script that executes the generate function of the dialect you're working with. To do that, you must install `tsx` to run Typescript files, `drizzle-orm` if it's not already installed and `drizzle-dbml-generator` of course.

```bash
# npm
npm i -D drizzle-dbml-generator ts-node
npm i drizzle-orm
npm i -D drizzle-dbml-generator tsx
# yarn
yarn add -D drizzle-dbml-generator ts-node
yarn add drizzle-orm
yarn add -D drizzle-dbml-generator tsx
# pnpm
pnpm add -D drizzle-dbml-generator ts-node
pnpm add drizzle-orm
pnpm add -D drizzle-dbml-generator tsx
```

### Example
Expand Down Expand Up @@ -134,7 +137,7 @@ Running the following command will generate the file with the DBML:

```bash
# You can add this as a package.json script
node --experimental-specifier-resolution=node --loader ts-node/esm dbml.ts
tsx dbml.ts
```

**schema.dbml**
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "drizzle-dbml-generator",
"version": "0.8.0",
"version": "0.9.0",
"description": "Convert your Drizzle ORM schema into DBML markup",
"main": "dist/index.cjs",
"module": "dist/index.js",
Expand Down Expand Up @@ -30,14 +30,15 @@
"@types/node": "^20.5.6",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"drizzle-orm": "^0.32.0",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",
"typescript": "^5.2.2",
"vitest": "^0.34.3"
},
"dependencies": {
"peerDependencies": {
"drizzle-orm": "^0.32.0"
}
}
Loading

0 comments on commit 8f29063

Please sign in to comment.