Dan Claroni
Dan Claroni
Explore posts from servers
DTDrizzle Team
Created by Lloyd on 6/11/2024 in #help
Top-level await in drizzle.config.ts
there isnt a way you know of to get migrate to work with top-level await is there? e.g. a patch to drizzle?
13 replies
DTDrizzle Team
Created by Lloyd on 6/11/2024 in #help
Top-level await in drizzle.config.ts
ah gotcha. I'm using SST and secrets make that more difficult to do. I suppose I can pass it in as an env var as well?
13 replies
DTDrizzle Team
Created by Lloyd on 6/11/2024 in #help
Top-level await in drizzle.config.ts
do you have a workaround
13 replies
DTDrizzle Team
Created by Lloyd on 6/11/2024 in #help
Top-level await in drizzle.config.ts
is there any update on this? I'm struggling with the same thing
13 replies
CDCloudflare Developers
Created by Stingo on 4/29/2024 in #browser-rendering-api
Forking time
were you successful at solving this with your fork? I think I need pupeteer-extra
2 replies
CDCloudflare Developers
Created by Dan Claroni on 5/28/2024 in #workers-help
how to convert puppeteer.HTTPResponse to cloudflare Response
Thank you so much! This worked. Do you have any tips on using puppeteer-extra and stealth?
3 replies
DTDrizzle Team
Created by Dan Claroni on 4/27/2024 in #help
using unions with "with" clause
Thank you!
16 replies
DTDrizzle Team
Created by Dan Claroni on 4/27/2024 in #help
using unions with "with" clause
@alexblokh @Andrew Sherman any ideas on this?
16 replies
DTDrizzle Team
Created by Dan Claroni on 4/27/2024 in #help
using unions with "with" clause
@Sillvva I got around to trying this today and it doenst work. you have to specify either db.select or db.with(sq).select for the right side of the union. Either way, drizzle wraps the entire left side in its own parens and the entire right side in its own parens, so the CTE is scoped within the parens. I tried using a query builder object too, but same issue
16 replies
DTDrizzle Team
Created by Dan Claroni on 4/27/2024 in #help
using unions with "with" clause
does that query you posted work for you just fine?
16 replies
DTDrizzle Team
Created by Dan Claroni on 4/27/2024 in #help
using unions with "with" clause
it's wrapping everything up until the union in parens
16 replies
DTDrizzle Team
Created by Dan Claroni on 4/27/2024 in #help
using unions with "with" clause
PostgresError: relation "usersSubQuery" does not exist
16 replies
DTDrizzle Team
Created by Dan Claroni on 4/27/2024 in #help
using unions with "with" clause
const usersSubQuery = db
.$with(usersSubQueryName)
.as(getUsersWithPrefsQuery());

const prefsSubQuery = getPrefsQuery(usersSubQuery); // uses db.with(usersSubQuery)

const recurringPrefsSubQuery = getRecurringPrefsQuery( // doesnt use db.with(usersSubQuery), but does use usersSubQuery in the from block
usersSubQuery,
);

const rows = await prefsSubQuery
.union(recurringPrefsSubQuery)
const usersSubQuery = db
.$with(usersSubQueryName)
.as(getUsersWithPrefsQuery());

const prefsSubQuery = getPrefsQuery(usersSubQuery); // uses db.with(usersSubQuery)

const recurringPrefsSubQuery = getRecurringPrefsQuery( // doesnt use db.with(usersSubQuery), but does use usersSubQuery in the from block
usersSubQuery,
);

const rows = await prefsSubQuery
.union(recurringPrefsSubQuery)
16 replies
DTDrizzle Team
Created by Dan Claroni on 4/27/2024 in #help
using unions with "with" clause
@Sillvva that query in the Union block throws an error that it doesn’t know about the usersSubQuery
16 replies
DTDrizzle Team
Created by Dan Claroni on 4/27/2024 in #help
using unions with "with" clause
i opened a GH issue with it, since I dont think this is possible https://github.com/drizzle-team/drizzle-orm/issues/2230
16 replies
DTDrizzle Team
Created by Dan Claroni on 4/27/2024 in #help
using unions with "with" clause
i'd like to do something like await db.with(usersSubQuery).union(prefsSubQuery, recurringPrefsSubQuery);
16 replies
DTDrizzle Team
Created by beneidel on 7/15/2023 in #help
"Cannot parse date or time" using AWS Data API, aurora postgres
The problem appears to be in drizzle-orm/pg-core/columns/timestamp.js. The offending code is:
mapToDriverValue = (value) => {
return this.withTimezone ? value.toUTCString() : value.toISOString();
};
mapToDriverValue = (value) => {
return this.withTimezone ? value.toUTCString() : value.toISOString();
};
the toUTCString() doesnt work for the data api, so I am going to make a patch where I just always congvert it to an ISO string. I'm assuming this has other implications for other drivers, but I don't know enough about that
17 replies
DTDrizzle Team
Created by beneidel on 7/15/2023 in #help
"Cannot parse date or time" using AWS Data API, aurora postgres
I’m not sure I want to remove the with timestamp. It appears drizzle is setup to convert date objects to ISO strings and then replace the T and the Z but for me it’s just using toString and still replacing the T, which you see when the T in Thurs is replaced with a space
17 replies