siim
siim
Explore posts from servers
DTDrizzle Team
Created by siim on 10/21/2024 in #help
Marking a Query relation as `required`?
I currently have a query like:
const friendTransactions = await db.query.transactions.findMany({
with: {
splits: {
where: (splits, { eq }) => eq(splits.friendId, foundFriend.id),
},
},
});
const friendTransactions = await db.query.transactions.findMany({
with: {
splits: {
where: (splits, { eq }) => eq(splits.friendId, foundFriend.id),
},
},
});
and I want to include splits where the friendId matches a specific value. This works, except I can't figure out the correct way to mark that relation as required (as in, I don't want to have the transaction row returned unless a split row exists that meets the filter condition. This has been a super easy feature in every other ORM I've used, but I can't find anything about it in the Drizzle docs. Anyone know how to accomplish this (preferably without reverting everything to a select() instead)
1 replies
DTDrizzle Team
Created by siim on 8/22/2023 in #help
`migrate()` prints to stdout
When I run the migrate() function it always prints content to stdout, and I can't find a way to disable it. I'm using migrate in tests, and it's super annoying because it's polluting the console and making the test output difficult to read. Does anyone know a workaround for this?
4 replies
TtRPC
Created by siim on 8/4/2023 in #❓-help
Multiple React Providers?
I'm trying to have multiple providers in the same react (they can't be merged w/ virtual routing). I'm trying to follow the example in this PR, but I can't get it working. https://github.com/trpc/trpc/pull/3049 No matter what I try, I get the error No QueryClient Set even though there is one and it's setup just like the test. Anyone have success with this?
1 replies