"table name specified more than once error in relational query

I am facing "table name 'Doctors_Chambers_ChamberAvailabilities_ChamberAvailabilityTimef' specified more than once" error when I add with: { AppointmentBookContactNumbers: true }
No description
No description
8 Replies
Md. Redwan Hossain
Md. Redwan HossainOP14mo ago
Anyone?
Angelelz
Angelelz14mo ago
The code seems fine, is that error coming from the database or drizzle?
Md. Redwan Hossain
Md. Redwan HossainOP14mo ago
Its from Database. Drizzle is generating troublesome query. I copied the generated sql and executed raw query by db client which throws the same error.
Angelelz
Angelelz14mo ago
Please paste the generated sql here
Md. Redwan Hossain
Md. Redwan HossainOP14mo ago
The generated query is too long for a message. Here is the code as github gist: https://gist.github.com/md-redwan-hossain/d8ab8a8d95d94f73be180dc203139136
Gist
query.sql
GitHub Gist: instantly share code, notes, and snippets.
Angelelz
Angelelz14mo ago
I think your problem is the length of the name the drizzle is giving to your columns in the innermost join I don't think we have a way to select a different name Would you like to create an issue in GH for the problem?
Md. Redwan Hossain
Md. Redwan HossainOP14mo ago
Ok. I will create an issue.
Torbaz
Torbaz10mo ago
hi, i couldnt find the issue opened by @Md. Redwan Hossain, however I have opened this for the same issue. https://github.com/drizzle-team/drizzle-orm/issues/2066
GitHub
[BUG]: Deeply nested queries fail due to table name length · Issue ...
What version of drizzle-orm are you using? 0.30.1 What version of drizzle-kit are you using? 0.20.14 Describe the Bug When creating a query with deeply nested data, the sql generated uses names bas...
Want results from more Discord servers?
Add your server