打算使用prisma
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user