postgresql-dart icon indicating copy to clipboard operation
postgresql-dart copied to clipboard

Postgres Database connection on Flutter Web

Open darshanpopat80802 opened this issue 4 years ago • 3 comments

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

darshanpopat80802 avatar Apr 06 '22 13:04 darshanpopat80802

Yes same issue for me pls provide a solution

abdullah230695 avatar Sep 11 '22 13:09 abdullah230695

image nowhere it says it supports web. i never hear that connecting to postgres directly from web browser is possible.

qrhfz avatar Oct 03 '22 06:10 qrhfz

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

osaxma avatar Oct 03 '22 07:10 osaxma

Closing as not actionable.

isoos avatar Sep 06 '24 21:09 isoos