windmill-labs / windmill

Open-source developer platform to power your entire infra and turn scripts into webhooks, workflows and UIs. Fastest workflow engine (13x vs Airflow). Open-source alternative to Retool and Temporal.
https://windmill.dev
Other
9.78k stars 453 forks source link

feat: add return_last_result annotation to sql #4443

Closed HugoCasa closed 6 days ago

HugoCasa commented 6 days ago

[!IMPORTANT] Add return_last_result annotation to SQL executors to conditionally return only the last result of queries.

  • Behavior:
    • Add return_last_result annotation handling in SQL executors (bigquery_executor.rs, mssql_executor.rs, mysql_executor.rs, pg_executor.rs, snowflake_executor.rs).
    • Modify query execution to conditionally skip result collection based on return_last_result.
  • Functions:
    • Add get_sql_annotations() in worker.rs to parse SQL annotations.
    • Update do_bigquery_inner(), do_mssql(), do_mysql_inner(), do_postgresql_inner(), do_snowflake_inner() to handle return_last_result.
  • Misc:
    • Update SQL script templates in script_helpers.ts to include return_last_result annotation.

This description was created by Ellipsis for c6577dbf8e0b8ec3a499e2839210f42f066e2ebe. It will automatically update as commits are pushed.