R/extendr-wrappers.R

Defines functions ffi_openlineage ffi_diff ffi_annotate_types ffi_optimize ffi_analyze ffi_lineage ffi_source_tables ffi_validate ffi_tokenize ffi_parse ffi_generate ffi_format ffi_transpile ffi_dialects_selfcheck ffi_dialects ffi_version

# Generated by extendr: Do not edit by hand
# nolint start

#' @usage NULL
#' @useDynLib polyglotSQL, .registration = TRUE
NULL

#' Version of the linked polyglot-sql crate (extracted from Cargo.lock at
#' build time; see build.rs).
#' @noRd
ffi_version <- function() .Call(wrap__ffi_version)

#' List built-in dialect names, aliases and descriptions.
#' @noRd
ffi_dialects <- function() .Call(wrap__ffi_dialects)

#' Assert the static DIALECTS table matches upstream name resolution.
#' Returns problems as a JSON array (empty when in sync). Used by tests.
#' @noRd
ffi_dialects_selfcheck <- function() .Call(wrap__ffi_dialects_selfcheck)

#' Transpile SQL between dialects.
#' @noRd
ffi_transpile <- function(sql, from, to, pretty, unsupported) .Call(wrap__ffi_transpile, sql, from, to, pretty, unsupported)

#' Pretty-format SQL with configurable complexity guards.
#' @noRd
ffi_format <- function(sql, dialect, max_input_bytes, max_tokens, max_ast_nodes, max_set_op_chain) .Call(wrap__ffi_format, sql, dialect, max_input_bytes, max_tokens, max_ast_nodes, max_set_op_chain)

#' Generate SQL from an AST (JSON produced by `ffi_parse`).
#' @noRd
ffi_generate <- function(ast_json, dialect) .Call(wrap__ffi_generate, ast_json, dialect)

#' Parse SQL into an AST, serialized as JSON.
#' @noRd
ffi_parse <- function(sql, dialect) .Call(wrap__ffi_parse, sql, dialect)

#' Tokenize SQL. Returns parallel arrays for cheap data.frame construction.
#' @noRd
ffi_tokenize <- function(sql, dialect) .Call(wrap__ffi_tokenize, sql, dialect)

#' Validate SQL syntax (optionally schema-aware).
#' @noRd
ffi_validate <- function(sql, dialect, strict_syntax, semantic, schema_json) .Call(wrap__ffi_validate, sql, dialect, strict_syntax, semantic, schema_json)

#' Source (physical) tables referenced by the SQL, across all statements.
#' @noRd
ffi_source_tables <- function(sql, dialect) .Call(wrap__ffi_source_tables, sql, dialect)

#' Column-level lineage. `column == ""` means "all output columns".
#' @noRd
ffi_lineage <- function(sql, dialect, column, schema_json) .Call(wrap__ffi_lineage, sql, dialect, column, schema_json)

#' Structured query analysis (shape, projections, relations, CTEs...).
#' @noRd
ffi_analyze <- function(sql, dialect, schema_json) .Call(wrap__ffi_analyze, sql, dialect, schema_json)

#' Optimize SQL and return the rewritten statement(s).
#' @noRd
ffi_optimize <- function(sql, dialect, schema_json) .Call(wrap__ffi_optimize, sql, dialect, schema_json)

#' Annotate a query's AST with inferred data types.
#' @noRd
ffi_annotate_types <- function(sql, dialect, schema_json) .Call(wrap__ffi_annotate_types, sql, dialect, schema_json)

#' Structural diff between two SQL statements.
#' @noRd
ffi_diff <- function(sql_from, sql_to, dialect, delta_only) .Call(wrap__ffi_diff, sql_from, sql_to, dialect, delta_only)

#' OpenLineage columnLineage facet for a SQL statement.
#' @noRd
ffi_openlineage <- function(sql, dialect, namespace, job_name, schema_json) .Call(wrap__ffi_openlineage, sql, dialect, namespace, job_name, schema_json)

# nolint end

Try the polyglotSQL package in your browser

Any scripts or data that you put into this service are public.

polyglotSQL documentation built on Sept. 27, 2026, 5:06 p.m.