Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Compliant with Microsoft SQL #1049

Unanswered
pepijn-hockers asked this question in Q&A
Discussion options

Hi there,

I was investigating this package for possible usage within my service. However, I couldn't find a reference on Microsoft SQL server. Is the package compliant and usable for Microsoft SQL? MSSQL?

Kind regards,

Pepijn

You must be logged in to vote

Replies: 2 comments 11 replies

Comment options

MSSQL support is planned but not implemented yet. Hopefully soon!

You must be logged in to vote
7 replies
Comment options

Yes, I did a search and can’t find anything. I guess the best option may be modifying an existing one such as the Vitess parser.

Comment options

What am I saying? Probably better to find an existing library in another language and port it.

Comment options

Since I saw you are using an ANTLR v4 based parser for SQLite, I found such a grammar for tsql. Not complete, but might be suitable as a starting point.

https://github.com/antlr/grammars-v4/tree/master/sql/tsql

Comment options

There is also a pre-generated Go package for this grammar:

https://github.com/bramp/antlr4-grammars/tree/master/tsql

Comment options

@kyleconroy in some spare time last year, I started building a native-go TSQL parser using Participle. I got it working with a large set of SELECT queries.

Obviously next on the agenda would be INSERT, UPDATE, DELETE. I'm wondering what other statements would need to be parseable for the package to be useful to sqlc.

Comment options

hi, what's the status on the Microsoft SQL compliance/support?

You must be logged in to vote
4 replies
Comment options

Still waiting for a MSSQL parser written in Go

Comment options

I was working on this a while back, got this far but no farther.

Comment options

@tooolbox last merge was 7 years ago but it seems like the conversation was still going with the author. Did the conversation continue elsewhere?

Comment options

No, it did not continue elsewhere. I suppose we were both busy and nothing further happened.

As of now I still don't have time to pursue that project further, but there is a parser for SELECT/UPDATE/INSERT/DELETE which passes a large number of test cases. Anyone is welcome to pick it up and take if further; if I need to shove an MIT license in there I will.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #1047 on June 15, 2021 15:47.

AltStyle によって変換されたページ (->オリジナル) /