© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
2 replies
DrX

creating external types based on drizzle types

hey I'm trying to abstract some of my drizzle calls into seperate functions to refactor my code. How would I go about getting the type that my .values() enforces on the current table and replacing my data: any with that?

export async function createInvite(data: any) {
  const invite = await db
    .insert(data)
    .values({
      ...data
    })
    .returning({ inviteId: data.id });

  return invite;
}
export async function createInvite(data: any) {
  const invite = await db
    .insert(data)
    .values({
      ...data
    })
    .returning({ inviteId: data.id });

  return invite;
}
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Drizzle types error
Drizzle TeamDTDrizzle Team / help
17mo ago
Drizzle-zod createInsertSchema types
Drizzle TeamDTDrizzle Team / help
3y ago
Using drizzle-zod on zod-based form
Drizzle TeamDTDrizzle Team / help
7mo ago
Drizzle not creating tables
Drizzle TeamDTDrizzle Team / help
6mo ago