Skip to main content

sqlglot_parse

Function sqlglot_parse 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn sqlglot_parse( sql: *const c_char, dialect: *const c_char, ) -> *mut c_char
Expand description

Parse a SQL string and return its AST serialised as JSON.

  • sql – null-terminated SQL string (required).
  • dialect – null-terminated dialect name, e.g. "postgres". Pass NULL for ANSI SQL.

Returns a heap-allocated JSON string on success, or NULL on failure. The caller must free a non-null return value with sqlglot_free.