Error on mutation `connection timeout error prisma.uRL.update()`

I'm building a url-shortner it just worked correctly until i added a redirect count trpc mutation before redirecting to the original url, it is giving connection timeout error on prisma.uRL.update() , idk why this is happening
please help
pages/[code].tsx
useEffect(() => {
    (async () => {
      if (typeof code === "string") {
        const output = await trpcCtx.fetchQuery(["url.getLongURL", { code }]);
        if (output.notFound) router.push("/notFound");
        else {
          await increaseRedirectCount.mutateAsync({
            id: output.id,
            redirects: output.redirects + 1,
          });
          router.push(output.longURL);
        }
      }
    })();
  });

i also tried using trpc number update increment but it was giving the same error
it redirects after a couple hundred mutations
i'm using sqlite as the database for now

my trpc mutation
  .mutation("increaseRedirectCount", {
    input: z.object({ id: z.string().cuid(), redirects: z.number() }),
    async resolve({ ctx, input }) {
      return await ctx.prisma.uRL.update({
        where: { id: input.id },
        data: {
          redirects: input.redirects,
        },
      });
    },
  });
unknown.png
Was this page helpful?