Text-to-SQL
The textToSQL function transforms natural language descriptions into executable SQL queries using advanced AI. This powerful feature allows you to generate complex database queries without writing SQL manually.
Function Signature
textToSQL(
prompt: string,
options?: TextToSQLOptions
): Promise<AsyncIterable<string>>
Parameters
- prompt (
string): Natural language description of the desired query - options (
TextToSQLOptions, optional): Configuration options- currentQuery (
string, optional): Existing query to refine or modify
- currentQuery (
Return Value
Returns a Promise<AsyncIterable<string>> that streams the generated SQL query in real-time.