Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
farreldarian committed Apr 9, 2024
1 parent 0f038b1 commit e792b6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ In addition to the Prisma features, you can also generate Drizzle-specific featu
| Key | Description | Default | Example |
| --------------- | --------------------------------- | ----------- | ----------- |
| output | Change the output | "./drizzle" | "../models" |
| | Generate single output file | | "drizzle.ts" |
| formatter | Run prettier after generation | - | "prettier" |
| relationalQuery | Flag to generate relational query | true | false |
| moduleResolution | Specify the [module resolution](https://www.typescriptlang.org/tsconfig#moduleResolution) that will affect the import style | _*auto_ | nodenext |
| verbose | Flag to enable verbose logging | - | true |
| **dateMode | Change the generated mode for date | "date" ||

_* It will find the closest tsconfig from the current working directory. Note that [extends](https://www.typescriptlang.org/tsconfig#extends) is not supported_

_*Does not work with sqlite_

### Setting up [relational query](https://orm.drizzle.team/docs/rqb)

```ts
Expand Down
8 changes: 6 additions & 2 deletions packages/generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ prisma generate

> **Note:** This generator will use the [default Prisma field mapping](https://www.prisma.io/docs/orm/reference/prisma-schema-reference#model-field-scalar-types), meaning any `@db.*` modifiers will be ignored for now.
**prisma-generator-drizzle** aims for 1:1 compatibility with Prisma, this means that you can use the generated Drizzle schema as a complete and familiar drop-in replacement for the Prisma client.
**prisma-generator-drizzle** aims for 1:1 compatibility with Prisma, this means that you can use the generated Drizzle schema as a complete and familiar drop-in replacement for the Prisma client.

- [Setup drizzle-kit](#setting-up-drizzle-kit)
- [Setup relational query](#setting-up-relational-query)
Expand All @@ -66,13 +66,17 @@ In addition to the Prisma features, you can also generate Drizzle-specific featu
| Key | Description | Default | Example |
| --------------- | --------------------------------- | ----------- | ----------- |
| output | Change the output | "./drizzle" | "../models" |
| | Generate single output file | | "drizzle.ts" |
| formatter | Run prettier after generation | - | "prettier" |
| relationalQuery | Flag to generate relational query | true | false |
| moduleResolution | Specify the [module resolution](https://www.typescriptlang.org/tsconfig#moduleResolution) that will affect the import style | _*auto_ | nodenext |
| verbose | Flag to enable verbose logging | - | true |
| **dateMode | Change the generated mode for date | "date" ||

_* It will find the closest tsconfig from the current working directory. Note that [extends](https://www.typescriptlang.org/tsconfig#extends) is not supported_

_*Does not work with sqlite_

### Setting up [relational query](https://orm.drizzle.team/docs/rqb)

```ts
Expand Down Expand Up @@ -201,4 +205,4 @@ Check also [the discussion](https://github.com/farreldarian/prisma-generator-dri

### SqliteError: NOT NULL constraint failed: \<table-name\>.id

Currently having `@default(autoincrement())` only work for postgres and mysql.
Currently having `@default(autoincrement())` only work for postgres and mysql.

0 comments on commit e792b6e

Please sign in to comment.