sqlrange icon indicating copy to clipboard operation
sqlrange copied to clipboard

Thoughts on using with pgx

Open dolzenko opened this issue 1 year ago • 4 comments

Again, thanks for sharing this :heart_decoration:, I like the API very much and it would allow us to save quite a few lines of code, but the problem I found is that it's slightly incompatible with pgx driver in native mode. And the pgx docs claim it's faster and more featureful in native mode https://github.com/jackc/pgx/wiki/Getting-started-with-pgx-through-database-sql . I was able to adapt the code quickly (it's nothing more than a QueryContext > Query change and Columns > FieldDescriptions [0]) but I was thinking if you probably will be interested in incorporating support somehow upstream (especially given pgx driver seems quite popular way to connect to Postgres).

[0] https://gist.github.com/dolzenko/7edf82537d4ded509c251e81b85512b4

dolzenko avatar Dec 05 '24 08:12 dolzenko

I was able to adapt the code quickly (it's nothing more than a QueryContext > Query change and Columns > FieldDescriptions [0

Interesting, can you share a repository with the code you modified?

I assume it's hardcoded, but it's OK for inspiration purpose

ccoVeille avatar Dec 05 '24 08:12 ccoVeille

@ccoVeille it's in the gist above, I migrated only query part tho

dolzenko avatar Dec 06 '24 13:12 dolzenko

Thanks, I should have read further, I missed the gist or thought it was something else

ccoVeille avatar Dec 06 '24 13:12 ccoVeille

I kept a track of your suggestion here

https://github.com/ccoveille-forks/achille-roussel-sqlrange/commit/beb3b16d195325a9e005fcedd72d10f71f932033

I simply copied and pasted, I made nothing else

ccoVeille avatar Dec 06 '24 13:12 ccoVeille