question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for binary type

See original GitHub issue

Problem

PostgreSQL, MySQL and SQLite provide capabilities to store binary blobs:

  • SQLite has a BLOB data type
  • PostgreSQL has bytea and a Large Object feature, which stores the binary data in a separate table in a special format, and refers to that table by storing a value of type OID in your table.
  • MySQL has BINARY and VARBINARY

Prisma does not support these data types.

Suggested solution

Add support for a binary type in PSL.

Alternatives

@onmyflow describes a workaround below.

Additional context

Original issue

Hi folks, I’m looking to store and access large arrays of binary data using PostgreSQL and Prisma, but it doesn’t seem like the type that would make the most sense for my use case here (bytea) is supported by Prisma. Is there some possible workaround or plans to add this as a supported type?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:21
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

6reactions
cappslockcommented, Sep 4, 2020

@albertoperdomo I can’t speak to their use cases, but I can say that for quick prototypes or internal apps it can be convenient to centralize everything in postgres, particularly if file storage needs are limited and file sizes small and there are not many concurrent users. I’m not aware of any scenario where this is the best thing to do, but there are places where it makes sense to save effort. It would be nice to have blobs as a supported type in Prisma.

EDIT: I guess this is a use case: https://wiki.postgresql.org/wiki/BinaryFilesInDB#When_should_files_be_stored_in_the_database.3F

5reactions
kentcdoddscommented, Jul 14, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

MicroStrategy support for binary data types
MicroStrategy support for binary data types ; SQL Server. Binary. Varbinary ; Sybase IQ. Binary. Varbinary ; Sybase ASE. Binary. Varbinary ; MySQL....
Read more >
Enabling binary support using the API Gateway console
The section explains how to enable binary support using the API Gateway console. As an example, we use an API that is integrated...
Read more >
Binary Data Types
The following aggregate functions are supported for binary data types: BIT_AND. BIT_OR.
Read more >
Binary data types
Columns that use the binary data types do not support some of the common query processing operations. For example, binary data type columns...
Read more >
Documentation: 15: 8.4. Binary Data Types
A binary string is a sequence of octets (or bytes). Binary strings are distinguished from character strings in two ways. First, binary strings...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found