Postgres Database connection on Flutter Web
Hello,
I have used this package to connect to postgres database directly from Flutter mobile application. But the same code is not working on Flutter web. Below is the error output:
Error: Unsupported operation: Socket constructor
at Object.throw_ [as throw] (http://localhost:53729/dart_sdk.js:5391:11)
at Function._connect (http://localhost:53729/dart_sdk.js:64558:17)
at Function.connect (http://localhost:53729/dart_sdk.js:64537:26)
at connection$.PostgreSQLConnection.new.open (http://localhost:53729/packages/postgres/src/query_queue.dart.lib.js:4540:46)
at open.next (
Any idea how I can connect to postgres database directly from Flutter Web App.
Thanks in Advance
Yes same issue for me pls provide a solution
nowhere it says it supports web. i never hear that connecting to postgres directly from web browser is possible.
A web app can't connect through a raw socket, it won't work. There is nothing we can do to support it.
by @isoos in https://github.com/isoos/postgresql-dart/issues/60#issuecomment-1242989099
Closing as not actionable.