Improve type conversion and responses for raw queries
See original GitHub issueBug description
I am using prisma.$queryRaw
for creating mapbox vector tiles from db using PostgreSQL and PostGIS
I expect get node.js Buffer in mvt
field but prisma query engine serialize the db response to text and I can’t correctly convert it to a buffer
Buffer.from(data.mvt as string, 'binary')
is not help!
How to reproduce
Expected behavior
prism should return a Buffer in place of text for binary data
Prisma information
Environment & setup
- OS: PopOS(Ubuntu 20.10)
- Database: PostgreSQL
- Node.js version: v14.15.1
- Prisma version:
@prisma/cli : 2.13.0
@prisma/client : 2.12.1
Current platform : debian-openssl-1.1.x
Query Engine : query-engine 833ab05d2a20e822f6736a39a27de4fc8f6b3e49 (at node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x)
Migration Engine : migration-engine-cli 833ab05d2a20e822f6736a39a27de4fc8f6b3e49 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core 833ab05d2a20e822f6736a39a27de4fc8f6b3e49 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt 833ab05d2a20e822f6736a39a27de4fc8f6b3e49 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Studio : 0.329.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (6 by maintainers)
Top Results From Across the Web
SQL Server Data Type Conversion Methods and performance ...
This artcile explores the SQL Server Data type conversion method and their performance comparison.
Read more >Scala Slick implicit conversion of multiple types in raw SQL ...
I haven't been able to find a solution to the implicit conversion problem, but I've found a workaround using more traditional slick syntax,...
Read more >SQL Query Optimization: 12 Useful Performance Tuning Tips ...
Read the tutorial to learn more about SQL Server performance tuning best practices that help greater improve SQL Server query optimization.
Read more >Raw Queries - Sequelize
As there are often use cases in which it is just easier to execute raw / already prepared SQL queries, you can use...
Read more >Data type conversion (Database Engine) - SQL Server
DECLARE @string VARCHAR(10); SET @string = 1; SELECT @string + ' is a string.' The int value of 1 is converted to a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Example:
You get the point.
Sorry to barge in. But I have exact the same issue using $queryRaw.
I’m using ulid to generate my ids.
My table:
I expect to get back something like:
Except when I console log the result of the raw query:
I should be receiving a buffer instead of an encoded string?
Let me know what you need to solve this issue.
Thanks