Get part of a text from DB with Prisma

Is there a way to get the first 50 symbols from a String column content instead getting the all content of 300 symbols for example. I know there are
SELECT LEFT(content, 50) AS preview
FROM your_table;

SELECT SUBSTRING(content FROM 1 FOR 50) AS preview
FROM your_table;
SELECT LEFT(content, 50) AS preview
FROM your_table;

SELECT SUBSTRING(content FROM 1 FOR 50) AS preview
FROM your_table;
What is the way in prisma?
1 Reply
Nurul
Nurul6mo ago
Hey @bockster6669 You would need to use Raw Query for this: https://www.prisma.io/docs/orm/prisma-client/queries/raw-database-access/raw-queries
Raw queries | Prisma Documentation
Learn how you can send raw SQL and MongoDB queries to your database using the raw() methods from the Prisma Client API.

Did you find this page helpful?