naming a model `Datasource` breaks generated return types
See original GitHub issueBug description
naming a model Datasource
will conflict with the generated Prisma.Datasource
type which I assume is related to the datasource
block in the schema.prisma
.
Query results of type Prisma.Datasource
will only have url
property.
How to reproduce
generate a Prisma Client that has a Datasource
model.
model Datasource {
id Int @id @default(autoincrement())
}
types generated incorrectly
Expected behavior
No response
Prisma information
model Datasource {
id Int @id @default(autoincrement())
}
generated model type
/**
* Model Datasource
*
*/
export type Datasource = {
id: number
}
generated type further down in index.d.ts
export type Datasource = {
url?: string
}
Environment & setup
- OS: confirmed on MacOS 12.3
- Database: generated with Postgres provider
- Node.js version: 17.7.1
Prisma Version
3.10
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Make changes to an existing data source in Power Pivot
If columns are named differently in the source and in the model, you can go back and forth between the two sets of...
Read more >GraphQL schema basics
Your GraphQL server uses a schema to describe the shape of your available data. This schema defines a hierarchy of types with fields...
Read more >Refresh breaks due to COLUMN NAME CHANGES? 3 ways to ...
A simple Power BI column name change in the data source can break a power query refresh. It can be really frustrating that...
Read more >Connecting with DataSource Objects (The Java™ Tutorials ...
Any connection produced by the BasicDataSource object ds will be a connection to the database CUSTOMER_ACCOUNTS . Registering DataSource Object with Naming ......
Read more >Replace Data Sources - Tableau Help
... new data source (or have a different name) are removed from the Data pane. ... the toolbar to revert the change and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Note that it would be better to avoid the conflict and not add more entries to the denylist
That would be one solution, yes. But for now this issue just tracks the problem, and the Client team can look into if it is possible to remove this limitation and clash somehow. We did so in the past for some of the terms.