"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 }
8 Replies
Anyone?
The code seems fine, is that error coming from the database or drizzle?
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.
Please paste the generated sql here
The generated query is too long for a message. Here is the code as github gist: https://gist.github.com/md-redwan-hossain/d8ab8a8d95d94f73be180dc203139136
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?
Ok. I will create an issue.
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...