Dan Claroni
Dan Claroni
Explore posts from servers
CDCloudflare Developers
Created by Dan Claroni on 5/28/2024 in #workers-help
how to convert puppeteer.HTTPResponse to cloudflare Response
I am trying to convert a puppeteer.HTTPResponse into a cloudflare response. Before I moved to cloudflare workers, I was able to do this with the following code. However, currently with cloudflare I get the following error: ReferenceError: Buffer is not defined Code that previously worked:
const response = await page.goto(request.url);
if (!response) {
throw new Error(`Request to ${request.url} failed.`);
}

return new Response(await response.text(), {
status: response.status(),
});
const response = await page.goto(request.url);
if (!response) {
throw new Error(`Request to ${request.url} failed.`);
}

return new Response(await response.text(), {
status: response.status(),
});
3 replies
DTDrizzle Team
Created by Dan Claroni on 4/27/2024 in #help
using unions with "with" clause
I am trying to do something like the following, but cant figure out how to do this with drizzle syntax.
WITH common_subquery AS (
SELECT user_id, column1, column2
FROM shared_table
WHERE condition
)
SELECT user_id, column1, column2
FROM common_subquery
JOIN table1 ...
UNION
SELECT user_id, column1, column2
FROM common_subquery
JOIN table2 ...
WITH common_subquery AS (
SELECT user_id, column1, column2
FROM shared_table
WHERE condition
)
SELECT user_id, column1, column2
FROM common_subquery
JOIN table1 ...
UNION
SELECT user_id, column1, column2
FROM common_subquery
JOIN table2 ...
16 replies