_count not working with typescript
See original GitHub issueBug description
The new introduced _count
property does not work with the generated Typescript
How to reproduce
This is a portion of the schema:
model Contratto {
id Int @id @default(autoincrement()) @map("id")
dataInizio DateTime @map("data_inizio")
dataFine DateTime @map("data_fine")
dataFirmaContratto DateTime? @map("data_firma_contratto")
dataChiusuraAnticipata DateTime? @map("data_chiusura_anticipata")
checkout Float? @map("checkout")
cauzione Float? @map("cauzione")
tipoRata TipoRata @map("tipo_rata")
idTariffa Int @map("id_tariffa")
tariffa Tariffa @relation(fields: [idTariffa], references: [id])
idTipoContratto Int @map("id_tipo_contratto")
tipoContratto TipoContratto @relation(fields: [idTipoContratto], references: [id])
idQuietanziante Int @map("id_quietanziante")
quietanziante Quietanziante @relation(fields: [idQuietanziante], references: [id])
note String? @map("note")
contrattiSuOspite ContrattoSuOspite[]
bollette Bolletta[]
@@map("contratto")
}
This is what I have if I want to get the number of “bollette” of a contract:
Expected behavior
I would expect to be able to use it, if _count is actually what I think it is.
Environment & setup
- OS:Ubuntu 20
- Database: Postgres
- Node.js version: 15
- Prisma version: 2.21.2
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:10 (3 by maintainers)
Top Results From Across the Web
typescript error with Property 'counter' does not exist on type ...
Hi I have a working example in js and am trying to port it over to tsx but the error I see is....
Read more >MySQL COUNT() Function - W3Schools
The COUNT() function returns the number of records returned by a select query. Note: NULL values are not counted. Syntax. COUNT(expression). Parameter Values ......
Read more >column-count - CSS: Cascading Style Sheets - MDN Web Docs
The column-count CSS property breaks an element's content into the specified number of columns.
Read more >TypeScript Contribution Diary: Pretty Error Counts - Medium
I've started making contributions to TypeScript, working my way up from small error reporting nitpicks to (hopefully!)
Read more >Documentation - Everyday Types - TypeScript
In this chapter, we'll cover some of the most common types of values you'll find in JavaScript code, and explain the corresponding ways...
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
Works for me too. Thanks for the support.
I did not add selectRelationCount, thanks