Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Korzunin committed Sep 11, 2021
1 parent d509e78 commit b178dd2
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A generator, which takes a Prisma 2 `schema.prisma` and generates Sequelize Mode

## Getting Started

**1. Install**
### 1. Install

npm:

Expand All @@ -26,7 +26,7 @@ yarn:
yarn add -D prisma-sequelize-generator
```

**2. Add the generator to the schema**
### 2. Add the generator to the schema

```prisma
generator client {
Expand All @@ -43,14 +43,30 @@ generator client {
}
```

**3. Run generation**
### 3. Run generation

prisma:

```shell
prisma generate
```

### 3. Use Sequelize Models to interact with your database

```typescript
import { createSequelizeInstance } from './prisma/sequelize';

const { sequelize, models } = new createSequelizeInstance({
ssl: true,
dialectOptions: {
connectTimeout: 1000,
},
});
// use `sequelize` instance and `models` in your application to read and write data in your DB
```

No need to set a connection string, it is set form the `datasource` configuration in your `schema.prisma` by default.

## Supported Node Versions

| Node Version | Support |
Expand Down

0 comments on commit b178dd2

Please sign in to comment.