Skip to content

Incorrect syntax near 'returning'. #44

Description

@jhchill666

I just can't figure out how returning should work.

Builder config:
{ dialect: 'mssql', separatedValues: false }

Query:

const query = {
        table: 'Messages',
        type: 'insert',
        returning: ['ID'],
        values: {
          Name: 'Blah',
          Text: 'Some text'
        }
      }

Yeilds:
insert into "Messages" ("Name", "Text") values ('Blah', 'Some text') returning "ID";

Error:
RequestError: Incorrect syntax near 'returning'.

Obviously this will fail, as is not valid MSSQL syntax.

Am just trying to output the inserted row's primary key. It doesn't seem like valid

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