Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect syntax near 'returning'. #44

Open
jhchill666 opened this issue May 10, 2019 · 2 comments
Open

Incorrect syntax near 'returning'. #44

jhchill666 opened this issue May 10, 2019 · 2 comments

Comments

@jhchill666
Copy link

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

@jhchill666
Copy link
Author

Ok, upon further investigation, seems that mssql dialect just uses the base dialect.

Seems there's a PR associated with this, but is 2 years old.

Is this library still maintained? Will the PR ever be merged?

@okv
Copy link
Contributor

okv commented May 12, 2019

Hello there.
Library is maintained but mostly for base dialect and postgresql.
It turned out that it's not just that simple to support a bunch of dialects (especially when you aren't using most them at all).
I don't think that ms sql dialect will be merged, sorry for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants