Spaces:
Sleeping
Sleeping
Download check-db.ts from underrate/webdev-service-backend: direct link, hf CLI and curl.
- Browser
- Download file 555 Bytes
-
https://huggingface.co/spaces/underrate/webdev-service-backend/resolve/main/check-db.ts
- Command line
-
hf download hf://spaces/underrate/webdev-service-backend/check-db.ts
-
curl -L -o check-db.ts https://huggingface.co/spaces/underrate/webdev-service-backend/resolve/main/check-db.ts
555 Bytes
| import { PrismaClient } from '@prisma/client' | |
| const prisma = new PrismaClient() | |
| async function main() { | |
| console.log("Fetching all blog posts..."); | |
| const posts = await prisma.blogPost.findMany(); | |
| console.log(`Total posts in DB: ${posts.length}`); | |
| if (posts.length > 0) { | |
| console.log("First post sample:", JSON.stringify(posts[0], null, 2)); | |
| } else { | |
| console.log("No posts found. Seed failed or ran on wrong DB?"); | |
| } | |
| } | |
| main() | |
| .catch(console.error) | |
| .finally(() => prisma.$disconnect()); | |