Home / Function/ useSqlEditorPrompt() — supabase Function Reference

useSqlEditorPrompt() — supabase Function Reference

Architecture documentation for the useSqlEditorPrompt() function in hooks.ts from the supabase codebase.

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

apps/studio/components/interfaces/SQLEditor/hooks.ts lines 129–151

export function useSqlEditorPrompt() {
  const [promptState, setPromptState] = useState<PromptState>(initialPromptState)
  const [promptInput, setPromptInput] = useState('')

  useEffect(() => {
    if (!promptState.isOpen) {
      setPromptInput('')
    }
  }, [promptState.isOpen])

  const resetPrompt = () => {
    setPromptState(initialPromptState)
    setPromptInput('')
  }

  return {
    promptState,
    setPromptState,
    promptInput,
    setPromptInput,
    resetPrompt,
  }
}

Subdomains

Called By

Frequently Asked Questions

What does useSqlEditorPrompt() do?
useSqlEditorPrompt() is a function in the supabase codebase.
What calls useSqlEditorPrompt()?
useSqlEditorPrompt() 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