Blume
Explore posts from serversDTDrizzle Team
•Created by Blume on 10/15/2023 in #help
Delete from join
Is it possible to do something like this:
With the ORM?
e.g.
Or do I need to write the full SQL statement in raw sql?
4 replies
DTDrizzle Team
•Created by Blume on 10/15/2023 in #help
Use column name in like operator
I'm trying to create a query with a join where I get all entries whose value starts with the value of the root table.
e.g.
Tags = { ..., tag: "some", ... }
tagsWithNoteIds = [{ ..., tag: "some", ... }, { ..., tag: "some/string", ... }]
I'm not sure how the syntax should be to do this in the like operator. Is this even possible?
When I debug the SQL that is created by this it uses
params: [ "[object Object]/%", "d792d767-6662-4a56-8b93-bb6dac1a350d" ]
for the params..
In the end it would still need a way to know, that the column name shouldn't be used as a raw string so maybe this is just not possible?2 replies
DTDrizzle Team
•Created by Blume on 10/14/2023 in #help
many-to-many query with where filter on second level
Hi, I'm trying to create a many-to-many query where I can filter on the second "with" level..
My schema looks like this:
And I tried to query it with
But it won't allow the where inside the second with.. Am I doing something wrong? Is this simply something that is not possible with drizzle?
What I'm aiming for is to get all Notes where the tag starts with
query.tag
.
I'm not that used to SQL so I might be missing some fundamentals to querying many-to-many relations.
In pure SQL I think it could be done with 2 left joins and some aggregation, right?2 replies