Luca
Luca
Explore posts from servers
CDCloudflare Developers
Created by Luca on 10/22/2024 in #pages-help
Failed to publish your Function. Got error: binding DB of type d1 failed to generate. Please try aga
Facing this error when attempting to deploy via NuxtHub.
4 replies
TtRPC
Created by Luca on 6/14/2023 in #❓-help
Error handling: Zod errors and manually thrown TRPCErrors have different shape
If zod validation fails, the client-side error.message contains a JSON encoded array of errors, but if a TRPCError is thrown in a procedure, error.message is simply the error message. Why do they have a different shape? How should I go about this? Should I try to standardize both to a JSON encoded array on the server? Or should I try to distinguish the two scenarios on the client-side?
4 replies
DTDrizzle Team
Created by Luca on 6/1/2023 in #help
noob help: INSERT with JOIN SQL to Drizzle
Frontend developer dabbling with SQL for the first time in years. With the help of ChatGPT I have the following query which works as intended. How do I construct with Drizzle such that I can supply my values using the .values() method?
INSERT INTO billing (team_id, credit_change, credits, type)
SELECT teams.id, billing.credit_change, teams.credits + billing.credit_change, 'runtime'
FROM teams
JOIN (
VALUES
(1, 100),
(2, 200),
(3, 150)
) AS billing(team_id, credit_change)
ON teams.id = billing.team_id;
INSERT INTO billing (team_id, credit_change, credits, type)
SELECT teams.id, billing.credit_change, teams.credits + billing.credit_change, 'runtime'
FROM teams
JOIN (
VALUES
(1, 100),
(2, 200),
(3, 150)
) AS billing(team_id, credit_change)
ON teams.id = billing.team_id;
7 replies