fix postgres error

This commit is contained in:
mtvpls
2026-02-08 01:18:14 +08:00
parent 1d3a7f2732
commit a2e07011ec
4 changed files with 195 additions and 597 deletions

View File

@@ -77,8 +77,8 @@ class PostgresPreparedStatement implements D1PreparedStatement {
try {
const convertedQuery = this.convertQuery(this.query);
// 使用 Vercel Postgres 的 unsafe 方法执行参数化查询
const result = await sql.unsafe(convertedQuery, this.params);
// 使用 Vercel Postgres 的 query 方法执行参数化查询
const result = await sql.query(convertedQuery, this.params);
if (!result || result.rows.length === 0) return null;
@@ -100,7 +100,7 @@ class PostgresPreparedStatement implements D1PreparedStatement {
try {
const convertedQuery = this.convertQuery(this.query);
const result = await sql.unsafe(convertedQuery, this.params);
const result = await sql.query(convertedQuery, this.params);
return {
success: true,
@@ -126,7 +126,7 @@ class PostgresPreparedStatement implements D1PreparedStatement {
try {
const convertedQuery = this.convertQuery(this.query);
const result = await sql.unsafe(convertedQuery, this.params);
const result = await sql.query(convertedQuery, this.params);
return {
success: true,