Skip to content

[FEATURE]: column.as("alias") method #2391

@erfanium

Description

@erfanium

Describe what you want

currently, the Column type has no as method, so I use column.getSQL().mapWith(column.mapFromDriverValue).as('alias') to properly select a column with alias.

const result = await db.select({
  sellerId: user.id.getSQL().mapWith(user.id.mapFromDriverValue).as('sellerId')
})

It would be nice to be able to just do it with:

const result = await db.select({
  sellerId: user.id.as('sellerId')
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthas-prThis issue has one or more PRs that that could close the issue when mergedpriorityWill be worked on nextqb/crud

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions