codex-ai-platform / api /lib /supabase.ts
3v324v23's picture
chore: initial commit for huggingface spaces
6bb2fbe
raw
history blame contribute delete
898 Bytes
/**
* 模拟 Supabase 客户端 (为了在没有 Supabase 时保证项目运行)
* 注意:由于用户要求“不接 Supabase”,这里暂时使用内存模拟或跳过数据库操作
*/
export const supabase = {
rpc: async (name: string, args: any) => {
console.log(`[Supabase Mock] 调用 RPC: ${name}`, args);
return { data: [], error: null };
},
from: (table: string) => ({
insert: async (data: any) => {
console.log(`[Supabase Mock] 插入表 ${table}:`, data);
return { data, error: null };
},
update: (data: any) => ({
eq: async (column: string, value: any) => {
console.log(`[Supabase Mock] 更新表 ${table} (条件 ${column}=${value}):`, data);
return { data, error: null };
},
}),
select: () => ({
eq: () => ({
single: async () => ({ data: null, error: null }),
}),
}),
}),
};