Gerbuuun
Explore posts from serversCDCloudflare Developers
•Created by Gerbuuun on 5/14/2024 in #workers-help
Programmatic PDF generation on worker
Hi everyone,
I've been looking for some way to generate PDFs within a worker script.
Currently I use the browser rendering api to create PDFs of a page but according to the dashboard a single invocation takes 6 seconds...
There must be a better and faster way right?
I looked into the javascript PDF libraries (pdfkit, jspdf, pdf-lib, pdfme, etc.) but these are very limited in their features (I cannot even use a bold font?).
I have no experience with Rust but I'm considering this more and more as it seems the only solution?
But before I plunge myself into the deep with learning a bit of Rust, I'm curious if there are any other solutions?
Will I run into the same problems as javascript (limited features)?
Can I improve the speed of puppeteer rendering the PDF?
This function renders the pdf on the worker:
6 replies
DTDrizzle Team
•Created by Gerbuuun on 5/8/2024 in #help
Database and Drizzle checkpoints are out of sync due to custom migrations.
Hi,
Due to some custom written migrations (SQLite table changes iykyk) the latest snapshot and current state of the database are out of sync. Is there a way to get them back in sync?
1 replies
Typescript nested generic resolves to unknown
Am I missing something?
In the following example, shouldn't the type of
result
resolve to { test: { title: 'test' } }
?
Instead it says it's of type Record<string, unknown>
Did I reach the limits of Typescript?7 replies
DTDrizzle Team
•Created by Gerbuuun on 7/3/2023 in #help
Drizzle-kit database push connection error
When trying to run
drizzle-kit push:mysql
to push my schema to Planetscale, I get the following error.
Am I missing something?
This is my drizzle.config.ts
And my .env
file looks like this:
4 replies
DTDrizzle Team
•Created by Gerbuuun on 4/17/2023 in #help
Syntax error mysql migration using composite primary key
This part of my migration won't run due to:
The table looks like this:
Where I want to link multiple addresses to a member object.
Im using the planetscale-serverless migrator.
8 replies
redirect after useFetch redirect response
When I use
useFetch
on a page to (for example) log in, I return a sendRedirect
from the api route like so:
This redirect, however, does not redirect the app but returns the redirected page as the data in:
Are redirects supported by the useFetch
function? Or do I need to catch the 302
http response and redirect manually?
(Same goes for $fetch. I might not quite understand how the function works)3 replies