You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to store binary data in a postgres database. For space saving I don't want to store it as a text field (base64 encoded). So I created a column of type bytea (which seemed like the correct type, although I have not used postgres a lot so not sure). Next I tried to execute an INSERT command with a parameter as a Uint8List but it threw an exception "Postgresql array types not implemented yet.".
I could do some work on this and create a pull request but I would need some pointers on how it should be implemented. Specifically about the function String encodeArray(List value) in type_converter.dart. I understand it needs to encode the incoming List to a string, but not sure of the format it should return.
The text was updated successfully, but these errors were encountered:
Without large changes to the library, the binary data will be sent across the wire as base64 anyway. So you will not get a performance benefit from using a bytea instead of base64 in a string.
One problem is that postgresql also supports array types. So List<int> should be interpreted as the postgresql type Integer[]. A Uint8List is a List<int>, so to be consistent should probably be treated the same.
So perhaps bytea data should only be used when declared explicitly. i.e.
conn.execute("insert into foo values (@1:bytea)", [bytes]);
I want to store binary data in a postgres database. For space saving I don't want to store it as a text field (base64 encoded). So I created a column of type bytea (which seemed like the correct type, although I have not used postgres a lot so not sure). Next I tried to execute an INSERT command with a parameter as a Uint8List but it threw an exception "Postgresql array types not implemented yet.".
I could do some work on this and create a pull request but I would need some pointers on how it should be implemented. Specifically about the function
String encodeArray(List value)
in type_converter.dart. I understand it needs to encode the incoming List to a string, but not sure of the format it should return.The text was updated successfully, but these errors were encountered: