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