stablekernel / postgresql-dart

Dart PostgreSQL driver: supports extended query format, binary protocol and statement reuse.
https://www.dartdocs.org/documentation/postgres/latest
BSD 3-Clause "New" or "Revised" License
129 stars 32 forks source link

Error: Unsupported operation: Socket constructor #142

Open Kobbers opened 4 years ago

Kobbers commented 4 years ago

i'm new to flutter, and was wondering how do i exactly use this i was creating a flutter for web, the documentation seems lacking for a newbie like me. when i do try to make a connection to my postgre DB i got this error "Error: Unsupported operation: Socket constructor", i do wander what to do, maybe i'm lacking some service or something...

Kobbers commented 4 years ago

nvm, i just read that it doesn't work directly for flutter-web, i guess

ghost commented 3 years ago

I am currently facing the same problem. Did you find a work around this issue?

isoos commented 3 years ago

When using Flutter Web, you are running the app in the browser. The app inside a browser can't connect to a random socket, only when using the http protocol (or in some cases ftp). Postgresql doesn't have an http interface, therefore you won't be able to connect to it from Flutter web (or from regular JS web).

ghost commented 3 years ago

Can you recommend/suggest a suitable framework that I will allow me to create a http interface for me to work with flutter(dart) app and PostgreSQL?

mfatihy70 commented 3 months ago

is there a way to work around this? i also use postgresql and it only doesnt work for web which is a shame.

isoos commented 3 months ago

@mfatihy70: development is no longer done in this repository.

To answer your question: no, the web platform doesn't allow regular network connections.