vitaly-t / pg-promise

PostgreSQL interface for Node.js
https://vitaly-t.github.io/pg-promise
MIT License
3.47k stars 217 forks source link

pg-promise from chrome #589

Closed Judimax closed 5 years ago

Judimax commented 5 years ago

Expected behavior

I need a version of this as an extension of the chrome browser. Or can someone guide me on how to build a js snippet that incorprates postgres protocol and allows me to connect and retrieve info from a postgresDB

Actual behavior

this or such the like does not exist

Steps to reproduce

Environment

Google Chrome | 71.0.3578.127 (Official Build) (64-bit) JavaScript | V8 7.1.302.33 Flash | 32.0.0.101 (not that it might be needed) Mozilla/5.0 (X11; CrOS x86_64 11151.113.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.127 Safari/537.36

vitaly-t commented 5 years ago

This library is for server-side only.

There is no such thing as PostgreSQL JavaScript driver for the client-side, and never will be.

Judimax commented 5 years ago

Very well, never say never, I will make one, can point me in the right direction concering postgres protocol

On Sat, Feb 23, 2019 at 5:58 PM Vitaly Tomilov notifications@github.com wrote:

This library is for server-side only.

There is no such thing as PostgreSQL JavaScript driver for the client-side, and never will be.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vitaly-t/pg-promise/issues/589#issuecomment-466708164, or mute the thread https://github.com/notifications/unsubscribe-auth/AUVb8cOciJ6CDUZogk10Uv1nQQRKWzhwks5vQceYgaJpZM4bONH9 .

-- Michael Odumosu Clerical Office Associate and Fullstack Freelance Software Developer

Information Tel:929-353-8278 Linkedin: https://www.linkedin.com/in/michael-odumosu-a58367b1 Facebook: https://www.facebook.com/mchael.odumosu Github: https://github.com/MichaelOdumosu57

vitaly-t commented 5 years ago

@MichaelOdumosu57 The right direction is not to do it. The reason it can only be a server-side:

Judimax commented 5 years ago

The Chrome browser is most likey more integrated with the OS and has access to more features than pgadmin4, I assume from inital theory and broad evaluation.

Security reasons in what context development or production, this need to to be a complex API, any attacker trying to access the port through my suggested browser API will have to deal with the hosting server's firewall which in enterprise production, should be strong enough in the first place.

On Sun, Feb 24, 2019 at 8:07 AM Vitaly Tomilov notifications@github.com wrote:

@MichaelOdumosu57 https://github.com/MichaelOdumosu57 The right direction is not to do it. The reason it can only be a server-side:

  • It requires tight integration with the hosting OS, which only Node.js can provide
  • Many security reasons

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vitaly-t/pg-promise/issues/589#issuecomment-466772796, or mute the thread https://github.com/notifications/unsubscribe-auth/AUVb8S31uRsentVN27WCpLLfpIqPCFOxks5vQo54gaJpZM4bONH9 .

-- Michael Odumosu Clerical Office Associate and Fullstack Freelance Software Developer

Information Tel:929-353-8278 Linkedin: https://www.linkedin.com/in/michael-odumosu-a58367b1 Facebook: https://www.facebook.com/mchael.odumosu Github: https://github.com/MichaelOdumosu57

vitaly-t commented 5 years ago

@MichaelOdumosu57 There are good reasons why such thing doesn't exist, and nobody is looking for it. Maybe you should start with that in your research :wink:

There are many confused questions on StackOverflow about it, like this one.

micimize commented 4 years ago

@vitaly-t a browser-compatible client would allow for deployment to cloudflare workers. There are other perfectly legitimate use cases for a browser client as well, such as a chrome extension for developer or internal BI tooling.

I know it's not technically feasible, because web standards doesn't include (or have intent to include) tcp sockets, but I don't think there's a reason to be so derisive about it, as if the idea is totally outlandish. Plenty of databases expose http APIs.

vitaly-t commented 4 years ago

@micimize The underlying driver does not support it, and so this library cannot do it either.

rozenmd commented 3 months ago

Hey @vitaly-t, as of pg@8.11, it does: https://developers.cloudflare.com/hyperdrive/configuration/connect-to-postgres/#supported-drivers

vitaly-t commented 3 months ago

Hey @vitaly-t, as of pg@8.11, it does: https://developers.cloudflare.com/hyperdrive/configuration/connect-to-postgres/#supported-drivers

Thanks, but I'm not sure ATM what it would take to add such compatibility. If you have an idea, PR-s are welcome!