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

Questions? Feedback? #1

Open
andywer opened this issue Dec 18, 2018 · 11 comments
Open

Questions? Feedback? #1

andywer opened this issue Dec 18, 2018 · 11 comments
Labels
question Further information is requested

Comments

@andywer
Copy link
Owner

andywer commented Dec 18, 2018

Add your feedback as a comment to this issue 📋

@andywer andywer added the question Further information is requested label Dec 18, 2018
@jtremback
Copy link

Just wanted to say that this looks awesome. Not sure we will use it given its early stage though.

@hassanNS
Copy link

hassanNS commented Nov 26, 2019

Hi, this project looks amazing. Is it possible to use this for validating plain SQL and not postgres sql?

@andywer
Copy link
Owner Author

andywer commented Nov 27, 2019

Is it possible to use this for validating plain SQL and not postgres sql?

Since Postgres' SQL dialect is just a superset of "vanilla" SQL, there should be no problem validating that 👍

I guess the only risk would be to use something too fancy that postgres/postguard understand and accept, but your non-postgres database (sqlite for instance) does not.

@gregplaysguitar
Copy link

This looks super cool. The thing that would make it perfect, from my point of view, would be if you could point it at an actual postgres schema definition (i.e. a directory containing .sql files) as the source of truth for the database, rather than defining it with defineTable. How much of a leap would that be?

@andywer
Copy link
Owner Author

andywer commented Jan 17, 2020

@gregplaysguitar Yeah, that would be great! Shouldn't be too hard either, now as I think about it…

Just not sure if I will have time to work on it anytime soon. I've been sick for the last week and a half and stuff is already piling up 😉

@gregplaysguitar
Copy link

@andywer do you have any pointers as to where to start with that? I'd love to help out, although I don't have much free time either...

@andywer
Copy link
Owner Author

andywer commented Jan 18, 2020

@gregplaysguitar You can have a look at:

I think the best way to get started with the pg-query-parser package is to write a tiny test script that parses a simple SQL query and prints the parsed AST. Then play around with the input query a little bit and check out the resulting output.

@gregplaysguitar
Copy link

Great, thanks! I’ve been wanting to dig into pg query parsing for another project too so keen to have a look at this. I’ll let you know how I go!

@LifeIsStrange
Copy link

LifeIsStrange commented May 10, 2022

Can it validate queries at runtime?
@andywer

@andywer
Copy link
Owner Author

andywer commented May 11, 2022

No, it's build-time-only 😉 @LifeIsStrange

@LifeIsStrange
Copy link

that's unfortunate :)
I have a use case where users write SQL queries on a web frontend and it would be nice to check the syntax validity on the client instead of doing roundtrips to the server.
The only solution I've found is https://github.com/paxdei/GWTJSqlParser but it is a bit obscure haha

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

No branches or pull requests

5 participants