Muhannad
Muhannad
Explore posts from servers
TtRPC
Created by Muhannad on 3/16/2024 in #❓-help
Trigger lambda configured with trpc using other events
Can I trigger a lambda configured with trpc api gateway adapter using events other than httpApi like from an sqs or a dynamodb stream event, how would I handle these requests with the router?
2 replies
DTDrizzle Team
Created by Muhannad on 3/8/2024 in #help
Insert multiple rows return order
Is the return value of an "insert many" operation ordered in the same order of the items passed to it
const result = await db.insert(myTable).values([{id:1},{id:2}]).returning({ id: myTable.id })
const result = await db.insert(myTable).values([{id:1},{id:2}]).returning({ id: myTable.id })
Can I be sure that result[0] has id 1 and result[1] has id 2?
1 replies
DTDrizzle Team
Created by Muhannad on 9/7/2023 in #help
pgEnum in multiple tables
How should I use the same enum in multiple tables? For example I have this enum in:
const ROLES = ['owner', 'admin', 'editor', 'viewer'] as const
const roleEnum = pgEnum('role', ROLES)
// in table I use it like this:
role: roleEnum('role')
const ROLES = ['owner', 'admin', 'editor', 'viewer'] as const
const roleEnum = pgEnum('role', ROLES)
// in table I use it like this:
role: roleEnum('role')
If I want to use the same role enum in another table should I use the same pgEnum `const roleEnum = pgEnum('role', ROLES) i.e. import it? Or create the same pgEnum again?
2 replies