Amur
Amur
Explore posts from servers
DTDrizzle Team
Created by jakeleventhal on 1/7/2024 in #help
Is there a better way to access enum types?
coming back to this conversation as i feel like working with enums is still annoying as you mentioned above we can do this workaround to get the types but what if i have a function and i want to check if the maketPlaceIntegration is Amazon with a typescript enum i would have something like this but this is not possible with pgEnum
const isAmazon = (integration: MarketPlaceIntegrationTypes) => {
if(integration === MarketPlaceIntegrationTypes.Amazon){
// do something
}
}
const isAmazon = (integration: MarketPlaceIntegrationTypes) => {
if(integration === MarketPlaceIntegrationTypes.Amazon){
// do something
}
}
6 replies
DTDrizzle Team
Created by Amur on 2/22/2024 in #help
Postgrest inserting json array results in stringified array
i ended up using a custom json field
export const customJsonb = <TData>(name: string) =>
customType<{ data: TData; driverData: string }>({
dataType() {
return "jsonb";
},
// @ts-expect-error https://github.com/drizzle-team/drizzle-orm/issues/1511#issuecomment-1824687669
toDriver(value: TData) {
return value;
},
})(name);

// schema
notes: customJsonb<Array<RecipeNote>>("notes"),
export const customJsonb = <TData>(name: string) =>
customType<{ data: TData; driverData: string }>({
dataType() {
return "jsonb";
},
// @ts-expect-error https://github.com/drizzle-team/drizzle-orm/issues/1511#issuecomment-1824687669
toDriver(value: TData) {
return value;
},
})(name);

// schema
notes: customJsonb<Array<RecipeNote>>("notes"),
5 replies
DTDrizzle Team
Created by mr_pablo on 5/24/2023 in #help
drop tables
i'd be curious about this too
23 replies
DTDrizzle Team
Created by Amur on 9/6/2023 in #help
Type of `tx` when using `db.transactions`
thanks for the help!
19 replies
DTDrizzle Team
Created by Amur on 9/6/2023 in #help
Type of `tx` when using `db.transactions`
i only want to rollback now if my query throws so that's fine
19 replies
DTDrizzle Team
Created by Amur on 9/6/2023 in #help
Type of `tx` when using `db.transactions`
yeah that works
19 replies
DTDrizzle Team
Created by Amur on 9/6/2023 in #help
Type of `tx` when using `db.transactions`
indeed there is no rollback but it's fine for now, i dont do manual rollbacks
19 replies
DTDrizzle Team
Created by Amur on 9/6/2023 in #help
Type of `tx` when using `db.transactions`
yeah this seems to work, i was overcomplicated it 😅
19 replies
DTDrizzle Team
Created by Amur on 9/6/2023 in #help
Type of `tx` when using `db.transactions`
postgres-js
19 replies
DTDrizzle Team
Created by Hugo on 8/29/2023 in #help
Zod schema validation from Drizzle schema
How does the interface for your CreateStoreForm props look like?
4 replies
DTDrizzle Team
Created by Noahh on 8/23/2023 in #help
Missing @opentelemetry/api module at runtime when upgrading to 0.28.4
i'll look into it a bit further, might be something on my side
55 replies
DTDrizzle Team
Created by Noahh on 8/23/2023 in #help
Missing @opentelemetry/api module at runtime when upgrading to 0.28.4
yeah it should be the version drizzle-orm@types-bugs without any cache
55 replies
DTDrizzle Team
Created by Noahh on 8/23/2023 in #help
Missing @opentelemetry/api module at runtime when upgrading to 0.28.4
now i'm a bit confused because if i deploy my lambdas locally then it works but if i deploy it through the aws codepipeline then it breaks with the same error
55 replies
DTDrizzle Team
Created by Noahh on 8/23/2023 in #help
Missing @opentelemetry/api module at runtime when upgrading to 0.28.4
seems to be working
55 replies
DTDrizzle Team
Created by Noahh on 8/23/2023 in #help
Missing @opentelemetry/api module at runtime when upgrading to 0.28.4
Yeah also getting this error🙈
55 replies
DTDrizzle Team
Created by Amur on 8/22/2023 in #help
DB connections hangs after successful execution in Lambda locally
seems like a really old issue with no real solutions
22 replies
DTDrizzle Team
Created by Amur on 8/22/2023 in #help
DB connections hangs after successful execution in Lambda locally
yes
22 replies
DTDrizzle Team
Created by Amur on 8/22/2023 in #help
DB connections hangs after successful execution in Lambda locally
did this for now, i guess it works (also weird that i can't do 0 for idle_timeout)
const idleTimeout = process.env.IS_LOCAL ? { idle_timeout: 0.1 } : {};
const queryClient = postgres(dbConfig.dbCredentials.connectionString, { ...idleTimeout });
const idleTimeout = process.env.IS_LOCAL ? { idle_timeout: 0.1 } : {};
const queryClient = postgres(dbConfig.dbCredentials.connectionString, { ...idleTimeout });
22 replies
DTDrizzle Team
Created by Amur on 8/22/2023 in #help
DB connections hangs after successful execution in Lambda locally
yeah if i dont have the drizzle stuff then its fine
22 replies
DTDrizzle Team
Created by Amur on 8/22/2023 in #help
DB connections hangs after successful execution in Lambda locally
well i'm switching from python to TS and i was using SQLAlchemy, there i didn't have this issue when using sls invoke
22 replies