29 lines
669 B
TypeScript
29 lines
669 B
TypeScript
import { PrismaClient } from '@prisma/client'
|
|
|
|
const prisma = new PrismaClient()
|
|
|
|
async function main() {
|
|
const [categories, scenes] = await Promise.all([
|
|
prisma.category.findMany({ select: { id: true, name: true, options: true } }),
|
|
prisma.scene.findMany({ select: { id: true, name: true, options: true } }),
|
|
])
|
|
|
|
console.log('Categories:')
|
|
categories.forEach(cat => {
|
|
console.log(`- ${cat.name}: ${cat.options}`)
|
|
})
|
|
|
|
console.log('\nScenes:')
|
|
scenes.forEach(scene => {
|
|
console.log(`- ${scene.name}: ${scene.options}`)
|
|
})
|
|
}
|
|
|
|
main()
|
|
.catch(err => {
|
|
console.error(err)
|
|
process.exit(1)
|
|
})
|
|
.finally(() => prisma.$disconnect())
|
|
|