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

Support proc-macro TokenStream #39

Open
khionu opened this issue Jan 26, 2019 · 1 comment
Open

Support proc-macro TokenStream #39

khionu opened this issue Jan 26, 2019 · 1 comment

Comments

@khionu
Copy link

khionu commented Jan 26, 2019

I'm currently writing a proc macro that uses SQL to generate code that works with the storage pattern in specs. As is, I have to call display on the TokenStream, which converts it to a raw string. This will mean I'm undoing the tokenization for this parser to re-tokenize, while it should be possible for this parser to use the TokenStream directly.

This is low priority for me, as this issue only causes excess compilation time, but after creating this proc macro, I can add it to my own to-do.

@nickolay
Copy link
Collaborator

nickolay commented May 7, 2019

I'm not sure what "the storage pattern in specs" refers to, but if you manage to convert a TokenTree to a Vec<sqltokenizer::Token>, you can hand it to the parser easily.

This could be a fun excercise, but I expect optimizing the sqlparser's side of things to be more fruitful as it currently does quite a few things in a slow way.

I do wonder how much SQL you have, as parsing 450 KB of SQL takes about 4 seconds for me, whereas compiling sqlparser (about 250 KB of rust) takes 5 seconds.

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