Ahmed
Ahmed
DTDrizzle Team
Created by paaradiso on 11/8/2023 in #help
Cannot read properties of undefined (reading 'referencedTable')
You should define both in your case
12 replies
DTDrizzle Team
Created by paaradiso on 11/8/2023 in #help
Cannot read properties of undefined (reading 'referencedTable')
You did define it in the database level, so the foreign key constraint will be enforced. But drizzle requires some configuration to use their query selector. Here's a quote from drizzle: "You might've noticed that relations look similar to foreign keys — they even have a references property. So what's the difference? While foreign keys serve a similar purpose, defining relations between tables, they work on a different level compared to relations. Foreign keys are a database level constraint, they are checked on every insert/update/delete operation and throw an error if a constraint is violated. On the other hand, relations are a higher level abstraction, they are used to define relations between tables on the application level only. They do not affect the database schema in any way and do not create foreign keys implicitly. What this means is relations and foreign keys can be used together, but they are not dependent on each other. You can define relations without using foreign keys (and vice versa), which allows them to be used with databases that do not support foreign keys, like PlanetScale."
12 replies
DTDrizzle Team
Created by paaradiso on 11/8/2023 in #help
Cannot read properties of undefined (reading 'referencedTable')
To use the query API, you should add the relation using relations in the schema file. Check this out: https://orm.drizzle.team/docs/rqb#declaring-relations
12 replies
DTDrizzle Team
Created by Twiser on 11/6/2023 in #help
TypeScript complaining about using a spread operator in partial select query
I've almost switched to the query API even if the query doesn't include joins! My issue has been resolved.
5 replies
DTDrizzle Team
Created by Ahmed on 9/30/2023 in #help
How do I configure SSL mode without using the connectionString parameter
In my mysql2 connection instance. I use this option
ssl: {
rejectUnauthorized: true,
}
ssl: {
rejectUnauthorized: true,
}
To solve this matter
2 replies
DTDrizzle Team
Created by Ahmed on 8/24/2023 in #help
cannot find package '@opentelemetry/api' in 0.28.4
0.28.5 fixed it 👍
7 replies
DTDrizzle Team
Created by Ahmed on 8/24/2023 in #help
cannot find package '@opentelemetry/api' in 0.28.4
Should I revert back the changes atm ?
7 replies
DTDrizzle Team
Created by Ahmed on 8/23/2023 in #help
Chain orderBy clause problem
Maybe I had the idea wrong because you either sort on name or rating. You can't have A-Z and lowest at the same time maybe.
33 replies
DTDrizzle Team
Created by Ahmed on 8/23/2023 in #help
Chain orderBy clause problem
I tend to leave everything to the db but this case had me some trouble
33 replies
DTDrizzle Team
Created by Ahmed on 8/23/2023 in #help
Chain orderBy clause problem
Everything is on the loader. the react component is just a plain jsx with conditional rendering
33 replies
DTDrizzle Team
Created by Ahmed on 8/23/2023 in #help
Chain orderBy clause problem
I'm using remix
33 replies
DTDrizzle Team
Created by Ahmed on 8/23/2023 in #help
Chain orderBy clause problem
Everything is on the url 👍 read and pass to the query
33 replies
DTDrizzle Team
Created by Ahmed on 8/23/2023 in #help
Chain orderBy clause problem
I might keep sorting the name on the database level and move the rating sort on the app level, do you suggest that ?
33 replies
DTDrizzle Team
Created by Ahmed on 8/23/2023 in #help
Chain orderBy clause problem
Can it be ordered by name first and when it's finished they get's ordered again by their rating ?
33 replies
DTDrizzle Team
Created by Ahmed on 8/23/2023 in #help
Chain orderBy clause problem
name: asc or desc rating: asc or desc Both must have a value
33 replies
DTDrizzle Team
Created by Ahmed on 8/23/2023 in #help
Chain orderBy clause problem
I want to sort both if specified by user. if they want asc or desc of both fields
33 replies
DTDrizzle Team
Created by Ahmed on 8/23/2023 in #help
Chain orderBy clause problem
The logged query
select `id`, `name`, `slug`, `email`, `section`, `field`, `department`, `rating`, `created_at`, `updated_at` from `instructors` where `instructors`.`section` = ? order by `instructors`.`name` desc, `instructors`.`rating` asc
select `id`, `name`, `slug`, `email`, `section`, `field`, `department`, `rating`, `created_at`, `updated_at` from `instructors` where `instructors`.`section` = ? order by `instructors`.`name` desc, `instructors`.`rating` asc
33 replies
DTDrizzle Team
Created by Ahmed on 8/23/2023 in #help
Chain orderBy clause problem
My first attempt was this implementation and It's ignoring the rating field 😅
33 replies
DTDrizzle Team
Created by Ahmed on 8/15/2023 in #help
[drizzle-zod] How to make all fields of a schema derived from a table required ?
This is what drizzle-zod do before creating the schema.
// Refining the fields - useful if you want to change the fields before they become nullable/optional in the final schema
// Refining the fields - useful if you want to change the fields before they become nullable/optional in the final schema
14 replies
DTDrizzle Team
Created by Ahmed on 8/15/2023 in #help
[drizzle-zod] How to make all fields of a schema derived from a table required ?
Strict mode is always enabled I'm inferring the type from parsing a zod schema
14 replies