generated from fahricansecer/boilerplate-be
This commit is contained in:
23
test-query.ts
Normal file
23
test-query.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
});
|
||||
Reference in New Issue
Block a user