## Node.to_sql()


The node's stage as SQL, in `dialect`: what [refresh](Node.refresh.md#sverify.Node.refresh) runs for a


Usage

``` python
Node.to_sql(dialect="duckdb")
```


full recompute, with every run-time check, and the meaning the proof gives it. Windows of a `deterministic` report need no row-order tiebreak ([Report.to_sql](Report.to_sql.md#sverify.Report.to_sql)).

The SQL reads the sources and stored nodes upstream by their names ([internal_plan](Node.internal_plan.md#sverify.Node.internal_plan)). A node whose contract is not proved is refused, as [refresh](Node.refresh.md#sverify.Node.refresh) refuses it; a node without a contract (a source, or a plain function's result) has no proof to check.


## Parameters


`dialect: Any = ``"duckdb"`  
`"duckdb"` (the default), `"snowflake"` or `"spark"`, or one of [sverify.engines.DUCKDB](engines.DUCKDB.md#sverify.engines.DUCKDB), [SNOWFLAKE](engines.SNOWFLAKE.md#sverify.engines.SNOWFLAKE) and [SPARK](engines.SPARK.md#sverify.engines.SPARK).


## Returns


`str`  
One SQL query.


## Raises


`ValueError`  
`dialect` is unknown.

`sverify.errors.UnverifiedRunError`  
The node's contract is not proved.

`sverify.errors.RouteError`  
No route takes the plan to the dialect's engine.

`sverify.errors.Unsupported`  
The dialect cannot express the plan.


## Examples

``` python
node = orders.pipe(paid)
print(node.to_sql("snowflake"))
```
