MCPcopy Create free account
hub / github.com/Rafacv23/F1-api / executeQuery

Function executeQuery

lib/executeQuery.ts:3–13  ·  view source on GitHub ↗
(
  sql: string,
  args: any[] = []
)

Source from the content-addressed store, hash-verified

1// Función para ejecutar una consulta SQL con parámetros preparados
2import { client } from "@/lib/turso"
3export async function executeQuery(
4 sql: string,
5 args: any[] = []
6): Promise<any> {
7 try {
8 const data = await client.execute({ sql: sql, args: args })
9 return data.rows
10 } catch (error: any) {
11 throw new Error("Error executing SQL query: " + error.message)
12 }
13}

Callers 1

GETFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected