打算使用prisma

This commit is contained in:
2025-11-13 10:30:28 +08:00
parent 94d570557b
commit adcb7920bd
11 changed files with 10794 additions and 15979 deletions

View File

@@ -1,4 +1,5 @@
import { Pool } from "pg";
import z from "zod";
export const pool = new Pool({
user: "postgres",
@@ -8,3 +9,16 @@ export const pool = new Pool({
connectionTimeoutMillis: 2000,
maxLifetimeSeconds: 60,
});
export const TextPairSchema = z.object({
id: z.number().int().positive(),
text1: z.string().min(1).max(100),
text2: z.string().min(1).max(100),
locale1: z.string().min(2).max(10),
locale2: z.string().min(2).max(10),
owner: z.string().min(1).max(40),
createdAt: z.date().default(() => new Date()),
updatedAt: z.date().default(() => new Date()),
});
export const