API with NestJS #178. Storing files inside of a PostgreSQL database with Drizzle
Briefly

Using the bytea column with the Drizzle ORM requires defining a custom type, since the ORM does not support bytea natively, ensuring smooth integration with TypeScript.
The implementation of file storage in PostgreSQL involves creating a service that accepts a file's name, type, and binary data buffer, facilitated by multipart/form-data requests.
To allow users to stream stored files, we add methods in our service and establish an endpoint that utilizes writable streams to deliver the file seamlessly.
The usage of the multer library in connection with multipart/form-data is crucial for processing file uploads, ensuring our application can handle binary data effectively.
Read at Marcin Wanago Blog - JavaScript, both frontend and backend
[
|
]