Skip to content

Commit

Permalink
add output example
Browse files Browse the repository at this point in the history
  • Loading branch information
ruheni committed Oct 30, 2023
1 parent 0a4deb2 commit 0571073
Showing 1 changed file with 43 additions and 6 deletions.
49 changes: 43 additions & 6 deletions content/400-reference/200-api-reference/200-command-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,13 @@ The `init` command does not interpret any existing files. Instead, it creates a
#### Arguments

| 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) | |
| `--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

##### Run `prisma init`
Expand Down Expand Up @@ -359,17 +358,55 @@ The command output contains helpful information on how to use the generated file

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

```terminal
prisma init --preview-feature multiSchema
<CodeWithResult outputResultText="Prisma schema" expanded={true}>

<cmd>```terminal prisma init --preview-feature multiSchema ```</cmd>

<cmdResult>

```prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["multiSchema"]
}
```

The command sets `multiSchema` as a Preview feature in your schema.
</cmdResult>

</CodeWithResult>

<CodeWithResult outputResultText="Prisma schema" expanded={true}>

<cmd>

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

The command sets `multiSchema` and `metrics` as the Preview features in your Prisma schema.
</cmd>

<cmdResult>

```prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["multiSchema", "metrics"]
}
```

</cmdResult>

</CodeWithResult>

#### Generated Assets

Expand Down

0 comments on commit 0571073

Please sign in to comment.