Home / Function/ isUpdateWithoutWhere() — supabase Function Reference

isUpdateWithoutWhere() — supabase Function Reference

Architecture documentation for the isUpdateWithoutWhere() function in SQLEditor.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  eddc0ceb_d5e3_44ba_28ba_017bdcf437b2["isUpdateWithoutWhere()"]
  5429b87d_ef53_7e21_26c6_6b167a463ebc["SQLEditor()"]
  5429b87d_ef53_7e21_26c6_6b167a463ebc -->|calls| eddc0ceb_d5e3_44ba_28ba_017bdcf437b2
  style eddc0ceb_d5e3_44ba_28ba_017bdcf437b2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/SQLEditor/SQLEditor.utils.ts lines 57–66

export function isUpdateWithoutWhere(sql: string): boolean {
  const updateWithoutWhereRegex =
    /(?:^|;)\s*update\s+(?:"[\w.]+"\."[\w.]+"|[\w.]+)\s+set\s+[\w\W]+?(?!\s*where\s)/is
  const updateStatements = sql
    .split(';')
    .filter((statement) => statement.trim().toLowerCase().startsWith('update'))
  return updateStatements.some(
    (statement) => updateWithoutWhereRegex.test(statement) && !/where\s/i.test(statement)
  )
}

Subdomains

Called By

Frequently Asked Questions

What does isUpdateWithoutWhere() do?
isUpdateWithoutWhere() is a function in the supabase codebase.
What calls isUpdateWithoutWhere()?
isUpdateWithoutWhere() is called by 1 function(s): SQLEditor.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free