listbooks.cjs 600 B

123456789101112
  1. const { PrismaClient } = require('@prisma/client');
  2. const p = new PrismaClient();
  3. (async () => {
  4. const books = await p.book.findMany({
  5. where: { id: { in: [40, 41, 42, 43, 44, 45, 46, 47, 48] } },
  6. select: { id: true, title: true, genStage: true, failedStage: true, progress: true, updatedAt: true, errorMsg: true }
  7. });
  8. books.forEach(b => {
  9. console.log(`[${b.id}] ${(b.title||'').substring(0,30).padEnd(30)} genStage=${(b.genStage||'').padEnd(25)} progress=${b.progress} failedStage=${b.failedStage||'-'} err=${(b.errorMsg||'').substring(0,50)}`);
  10. });
  11. await p.$disconnect();
  12. })();