Skip to content

Typescript problem with raw inside returning() function #2337

@OlivierCuyp

Description

@OlivierCuyp

Here is the issue:

await Address.query()
      .insert(data)
      .returning([
        'id',
        'userId',
        'postalCode',
        'street',
        'city',
        'countryCode',
        'createdAt',
        'updatedAt',
        raw('ST_AsGeoJSON(??) AS ??', ['geoPoint', 'geoPoint']) // Typing error !
      ]);

Same issue seemed to be sloved in knex:

knex/knex#4879

I guess something similar could be done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions