Skip to content

[FEATURE]: Insert returning with query options #4284

@Aymericr

Description

@Aymericr

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Example:

await db
    .insert(schema.messages)
    .values({
      chatId,
      userId,
      content,
    })
    .returning({
      with: {
        user: true
      }
    })

similar typesafety to:

await db.query.messages.findMany({
   where: ...
   with: {
     user: true
   }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions