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

Add pgwire PostgreSQL wire protocol interface to CLI #10

Open
shah opened this issue Aug 18, 2023 · 10 comments
Open

Add pgwire PostgreSQL wire protocol interface to CLI #10

shah opened this issue Aug 18, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@shah
Copy link

shah commented Aug 18, 2023

Hello @AmrDeveloper this is a fantastic library, thanks for putting it together!

We have a need to query our Git repos using SQL but with a PosgreSQL wire protocol (so we can use it with psql or any other PostgreSQL client application).

If you're willing, we'd love to see you add a server mode in GQL using Rust pgwire crate. pgwire does all the hard work of setting up a PostgreSQL wire compatible server and can accept SQL through the wire and pass it into your GQL crates/code.

Something like this:

gql server --repo=NAME,/path/to/repo --repo=NAME2,/path/to/repo2 --port 5432 
  • NAME, NAME2 would be schema names (case insensitive)
  • /path/to/repo would be the repo names

The above would launch a server listening on port 5432 that would make gql pretend to be a PostgreSQL server. Then, any SQL sent to the GQL server through any PostgreSQL client would be sent to GQL and responses returned using PostgreSQL wire protocol.

We would be able to use NAME and NAME2 schema names to combine multiple repos' output.

@AmrDeveloper
Copy link
Owner

Hello @shah,

That's sound very cool and can be used in many projects, thanks you so much for suggestion, My first plan is to start improving the core of GQL and then working on supporting for clients but i think it will be good to start checking PosgreSQL wire protocol and maybe start this module side by side with the core.

Thank you,
Amr Hesham

@AmrDeveloper AmrDeveloper added the enhancement New feature or request label Aug 18, 2023
@AmrDeveloper
Copy link
Owner

GQL now has support for queering multi repositories :D

@shah
Copy link
Author

shah commented Aug 20, 2023

That's great news, @AmrDeveloper I appreciate the quick acceptance!

@Lilit0x
Copy link
Contributor

Lilit0x commented Aug 22, 2023

Hey @AmrDeveloper , your code works great with multiple repositories but we could use a column called repo in each table so that when you query multiple repos, we could use the repo column in our WHERE criteria.

@AmrDeveloper
Copy link
Owner

Hey @AmrDeveloper , your code works great with multiple repositories but we could use a column called repo in each table so that when you query multiple repos, we could use the repo column in our WHERE criteria.

Nice idea, i will implement it, Thanks for suggestion

@AmrDeveloper
Copy link
Owner

Hey @AmrDeveloper , your code works great with multiple repositories but we could use a column called repo in each table so that when you query multiple repos, we could use the repo column in our WHERE criteria.

Done, i implemented it now and will be released soon

@Lilit0x
Copy link
Contributor

Lilit0x commented Sep 3, 2023

@AmrDeveloper , hi there.
Has this been released? I tried this now with the package, it throws an error, but it works when I compiled the code.

@AmrDeveloper
Copy link
Owner

I will release it by the end of this week at most because i am working on big improvements in error handling, functions and performance

@ManUtopiK
Copy link

@shah « We have a need to query our Git repos using SQL but with a PosgreSQL wire protocol (so we can use it with psql or any other PostgreSQL client application). »
Very neat idea ! With a postgreSQL wire, we could use some automatic SQL to graphQL tools like Hasura or plateformaticDB to provide a grapQL endpoint to query git repositories. It would be awesome !

@AmrDeveloper
Copy link
Owner

GitQL 0.22.0 now has more features from postgreSQL and we can work on the write soon

Thank you

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

No branches or pull requests

4 participants