tpetry / laravel-postgresql-enhanced

Support for many missing PostgreSQL specific features
MIT License
773 stars 31 forks source link

Adding support for bytea columns #69

Closed kevin-cyster-rocketseed closed 12 months ago

kevin-cyster-rocketseed commented 1 year ago

Firstly, thank you for your brilliant work.

After using your package to access some of the functionality that the core laravel packages do not possess, I have discovered that even your package does not cater for Bytea columns.

As per this comment https://github.com/laravel/framework/issues/10847#issuecomment-512612353 (which I have tested locally) and is available in the fork https://github.com/Rocketseed-Development/laravel-postgresql-enhanced.

I propose adding the following function to PostgresEnhancedConnection.php

` /**

tpetry commented 1 year ago

My expressions package has a value type. Can you try whether using the value in binary mode will solve the problem`

new Value('....', binary: true)
kevin-cyster-rocketseed commented 1 year ago

My expressions package has a value type. Can you try whether using the value in binary mode will solve the problem`

new Value('....', binary: true)

Thank you for your reply.

I added your other package tpetry/laravel-query-expressions to my project and defined the Bytea field as explained.

Yes. The binary mode does seem to solve the problem with inserting into the table.

I'm currently running some more tests just to make sure that the stream can be converted back to an image

tpetry commented 12 months ago

Awesome, so it works as expected.