Varna
Explore posts from serversDTDrizzle Team
•Created by Varna on 7/23/2024 in #help
Counting many-to-many items
Hello, any suggestions how should I query for item and count the numbers of times it is referenced via many-to-many table?
Given these tables:
4 replies
DTDrizzle Team
•Created by Varna on 4/16/2024 in #help
text mode json for sqlite Dq doesn't parse by default
I get
SyntaxError: "undefined" is not valid JSON
for json_string: text("json_string", { mode: "json" })
field.
When I use methods like:
or
while it does work and return string, If I manually select it by:
I'm using D1 db.3 replies
DTDrizzle Team
•Created by Varna on 3/6/2024 in #help
How can I extend drizzle tables?
I noticed that I write a lot of boilerplate code. When I had to update one of such types, I refactored them a bit, into reusable thing:
This worked out pretty well for that time. But now, I keep writing tons of services, and I want to make some reusable functions, but I struggle with TS trying to do that. i.e. I want to make a service
getItems
:
But types on this thing are totally wrong, and I'm not sure where should I start to approach this problem.
Another example, I have some subqueries like these:
It would be nice if I could refactor it into getID
, that takes Table as prop:
But I just don't get how to define the Table type in TS.1 replies