Summary: - Fix pg-boss queue conflict (duplicate key violation on queue_pkey) - Add global error listener to prevent process crash - Reduce connection pool from 10 to 4 - Add graceful shutdown handling (SIGTERM/SIGINT) - Fix researchWorker recursive call bug in catch block - Make screeningWorker idempotent using upsert Security Standards (v1.1): - Prohibit recursive retry in Worker catch blocks - Prohibit payload bloat (only store fileKey/ID in job.data) - Require Worker idempotency (upsert + unique constraint) - Recommend task-specific expireInSeconds settings - Document graceful shutdown pattern New Features: - PKB signed URL endpoint for document preview/download - pg_bigm installation guide for Docker - Dockerfile.postgres-with-extensions for pgvector + pg_bigm Documentation: - Update Postgres-Only async task processing guide (v1.1) - Add troubleshooting SQL queries - Update safety checklist Tested: Local verification passed
42 lines
705 B
TypeScript
42 lines
705 B
TypeScript
import { PrismaClient } from '@prisma/client';
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
console.log('=== platform_schema.users ===');
|
|
const platformUsers: any[] = await prisma.$queryRaw`
|
|
SELECT id, name, phone, role FROM platform_schema.users ORDER BY created_at
|
|
`;
|
|
platformUsers.forEach(u => console.log(` ${u.id}: ${u.name} (${u.phone}) [${u.role}]`));
|
|
|
|
console.log('\n=== public.users ===');
|
|
const publicUsers: any[] = await prisma.$queryRaw`
|
|
SELECT id, name, email FROM public.users
|
|
`;
|
|
publicUsers.forEach(u => console.log(` ${u.id}: ${u.name} (${u.email})`));
|
|
}
|
|
|
|
main()
|
|
.catch(console.error)
|
|
.finally(() => prisma.$disconnect());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|