Calender & Linked Added
This commit is contained in:
+4
-1
@@ -16,9 +16,12 @@ pool.on("error", (err) => {
|
||||
console.error("Unexpected database pool error:", err)
|
||||
})
|
||||
|
||||
export async function query(text: string, params?: unknown[]) {
|
||||
export async function query(text: string, params?: unknown[], userId?: string) {
|
||||
const client = await pool.connect()
|
||||
try {
|
||||
if (userId) {
|
||||
await client.query("SELECT set_config('app.current_user_id', $1, true)", [userId])
|
||||
}
|
||||
const result = await client.query(text, params)
|
||||
return result
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user