Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add example on how to use prisma init --preview-feature #5403

Merged
merged 10 commits into from
Oct 30, 2023
29 changes: 22 additions & 7 deletions content/400-reference/200-api-reference/200-command-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,14 @@ The `init` command does not interpret any existing files. Instead, it creates a

#### Arguments

| Argument | Required | Description | Default |
|-------------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|
| `--datasource-provider` | No | Specifies the default value for the `provider` field in the `datasource` block. Options are `sqlite`, `postgresql`, `mysql`, `sqlserver`, `mongodb` and `cockroachdb`. | `postgresql` |
| `--url` | No | Define a custom datasource url. | |
| `--generator-provider` | No | Define the default generator provider to use. | `prisma-client-js` |
| `--preview-features` | No | Define the default Preview features to use. [Learn more](/concepts/components/preview-features) | |
| `--output` | No | Specifies the default output location for the generated client. [Learn more](/concepts/components/prisma-client/working-with-prismaclient/generating-prisma-client#using-a-custom-output-path) | `node_modules/.prisma/client` |
| Argument | Required | Description | Default |
|-------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|
| `--datasource-provider` | No | Specifies the value for the `provider` field in the `datasource` block. Options are `sqlite`, `postgresql`, `mysql`, `sqlserver`, `mongodb` and `cockroachdb`. | `postgresql` |
| `--url` | No | Define a custom datasource url. | |
| `--generator-provider` | No | Define the generator provider to use. | `prisma-client-js` |
| `--preview-feature` | No | Define the [Preview features](/concepts/components/preview-features) to use. . To define multiple Preview features, you have to provide the flag multiple times for each Preview feature [See example](#run-prisma-init---preview-feature) | |
ruheni marked this conversation as resolved.
Show resolved Hide resolved
| `--output` | No | Specifies the [output location for the generated client](/concepts/components/prisma-client/working-with-prismaclient/generating-prisma-client#using-a-custom-output-path). | `node_modules/.prisma/client` |


#### Examples

Expand Down Expand Up @@ -356,6 +357,20 @@ prisma init --datasource-provider sqlite

The command output contains helpful information on how to use the generated files and begin using Prisma with your project.

#### Run `prisma init --preview-feature`

```terminal
prisma init --preview-feature multiSchema
```

The command sets `multiSchema` as a Preview feature in your schema.

```terminal
prisma init --preview-feature multiSchema --preview-feature metrics
```

The command sets `multiSchema` and `metrics` as the Preview features in your Prisma schema.
ruheni marked this conversation as resolved.
Show resolved Hide resolved

#### Generated Assets

**`prisma/schema.prisma`**
Expand Down
Loading