is it possible to write any logic like this using OR ?
SELECT p.*
FROM products p
JOIN categories c ON p.category_id = c.category_id
WHERE c.full_path LIKE 'Electronics/Laptop/%' OR c.full_path = 'Electronics/Laptop';
is it possible to write any logic like this using OR ?
13 Replies
i'm confused, this should do exactly what you want
what is your question
not row but dirzzle orm stuff
Drizzle ORM - next gen TypeScript ORM
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
umm not sure what's wrong. it works when I put withotu variable the pathname


this one works without the pathurl in a variable

how can I put the Electronic/Laptop dy namicly from variable
@francis
why are you not using the actual query builder api
it shows raw SQL don't have any option to use OR without raw SQL
?????????
read the link I said
.where(or(condition1, condition2))
?????saw there arleady

umm
fak
I missed
dude that is illustrating what the generated sql is
yea my bad
@francis thanks bro. I thought not possbile cuz the ai on drizzle orm was saying rip.