generated from fahricansecer/boilerplate-be
24 lines
508 B
TypeScript
24 lines
508 B
TypeScript
import { PrismaClient } from '@prisma/client';
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
const masterContents = await prisma.masterContent.findMany({
|
|
orderBy: { createdAt: 'desc' },
|
|
take: 5,
|
|
include: {
|
|
contents: true
|
|
}
|
|
});
|
|
|
|
console.log(JSON.stringify(masterContents, null, 2));
|
|
}
|
|
|
|
main()
|
|
.then(() => prisma.$disconnect())
|
|
.catch(e => {
|
|
console.error(e);
|
|
prisma.$disconnect();
|
|
process.exit(1);
|
|
});
|