MCPcopy Index your code
hub / github.com/simstudioai/sim / executeDelete

Function executeDelete

apps/sim/app/api/tools/postgresql/utils.ts:180–196  ·  view source on GitHub ↗
(
  sql: any,
  table: string,
  where: string
)

Source from the content-addressed store, hash-verified

178}
179
180export async function executeDelete(
181 sql: any,
182 table: string,
183 where: string
184): Promise<{ rows: unknown[]; rowCount: number }> {
185 validateWhereClause(where)
186
187 const sanitizedTable = sanitizeIdentifier(table)
188 const query = `DELETE FROM ${sanitizedTable} WHERE ${where} RETURNING *`
189 const result = await sql.unsafe(query, [])
190
191 const rowCount = result.count ?? result.length ?? 0
192 return {
193 rows: Array.isArray(result) ? result : [result],
194 rowCount,
195 }
196}
197
198export interface IntrospectionResult {
199 tables: Array<{

Callers 1

route.tsFile · 0.90

Calls 3

validateWhereClauseFunction · 0.70
sanitizeIdentifierFunction · 0.70
unsafeMethod · 0.65

Tested by

no test coverage detected