JustKira
DTDrizzle Team
•Created by JustKira on 4/27/2024 in #help
Circular Reference Error when Using Self-Reference in Table Definition with Drizzle-ORM
I encountered an error while defining a PostgreSQL table using Drizzle-ORM. The issue arises when attempting to create a self-referencing array column that references the primary key of its own table. The error message suggests that there is an issue with type inference possibly due to the self-reference.
Expected Behavior:
I expect to define a self-referencing column (dependencies_courses) that can store an array of course IDs, referencing the id column of the same course table without causing a type inference issue.
2 replies
DTDrizzle Team
•Created by JustKira on 1/19/2024 in #help
Drizzle ORM: Inferring Relation multiple Many to one relation
Hi everyone,
I'm working on a project using Drizzle ORM in a Next.js environment and I've run into a snag. My goal is to set up a database schema for an educational platform where courses have dependencies on other courses. Specifically, I'm trying to establish two types of relationships in my courses table:
Course Dependencies: Identifying the prerequisite courses for a given course.
Dependent Courses: Listing the courses that depend on a given course as a prerequisite.
However, I'm encountering an error when trying to infer the relation for dependentCourses in my courses table. Here's the error message I received:
Error
4 replies
DTDrizzle Team
•Created by JustKira on 12/17/2023 in #help
update not working
this is my api endpoint for patching i have test ...body if values are correct and if data.user.id exist everything should be fine and return true but when i check database it doesnt seem to be updated
for more context im using NEXTJS + react query
2 replies