question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1st vs. repeated run experience of `prisma generate`

See original GitHub issue

When starting out with Prisma, it’s helpful to provide more context to the users in CLI output. That CLI output becomes superfluous after a while.

One example is the prisma generate command which has this output:

[✔ Created `./package.json`]
[✔ Installed the `@prisma/client` package in your project]
✔ Generated Prisma Client to ./node_modules/@prisma/client in 1.48s

You can now start using Prisma Client in your code:

```
import { PrismaClient } from '@prisma/client'
// or const { PrismaClient } = require('@prisma/client')

const prisma = new PrismaClient()
```

Explore the full API: http://pris.ly/d/client

The helpful import snippet is probably not as valuable any more once you ran the command a few times. So we might want to think of a mechanism how to remove it for later invokations.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Jolg42commented, Jan 28, 2022

I think in the past, why we didn’t want to do that might be that prisma generate is called on postinstall so in this case you might never see this help message because the directory would already exists, before the user actually runs the generate command.

To check and decide if we consider this a problem or not.

1reaction
weslordcommented, Jan 28, 2022

What about displaying it only when the client generation output directory did not previously exist and had to be created?

In that case, the message would only be displayed on initial installation (possible new user), if the output directory setting gets changed (therefore imports need to be updated), or if someone has deleted everything and is starting from scratch (something possibly went wrong with their configuration).

If the directory does exist, it’s a very good sign that the user has already set things up. Plus the default client import location is described in multiple places in the docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generators (Reference) - Prisma
A generator determines which assets are created when you run the prisma generate command. The main property provider defines which Prisma Client (language ......
Read more >
prisma2 generate output message always says You can now ...
prisma2 generate output message always says You can now start using Prisma ... 1st vs. repeated run experience of prisma generate #3390.
Read more >
Start using Prisma in your existing database with ... - Medium
If you are a javascript or typescript developer, I think you've ... 1. Generate Prisma client from Prisma schema. npx prisma generate.
Read more >
How Prisma Introspects a Schema from a MongoDB Database
As there is no SQL to modify the database structure (which is not written down or defined anywhere), Prisma also did not have...
Read more >
repeated measures - GraphPad Prism 9 Statistics Guide
The repeat can be across time (eg. pre/post), across different conditions (eg. high and low temperature), or across space (eg. left knee and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found