From fbef18548e09f001c1b744619bfa00f30c70350a Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 10:19:09 +0000 Subject: [PATCH] fix: replace SELECT * with explicit fields in clone_script function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace SELECT * query with explicit column selection in the clone_script function to improve code clarity and ensure all Script struct fields are properly mapped from the database query. This change lists all 37 fields from the Script struct explicitly, making the query more maintainable and less prone to errors when the struct or schema changes. Fixes #6913 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Co-authored-by: windmill-internal-app[bot] --- backend/windmill-common/src/scripts.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/backend/windmill-common/src/scripts.rs b/backend/windmill-common/src/scripts.rs index 9c1af245d8..9dbf04208d 100644 --- a/backend/windmill-common/src/scripts.rs +++ b/backend/windmill-common/src/scripts.rs @@ -730,12 +730,20 @@ pub async fn clone_script<'c>( deployment_message: Option, tx: &mut sqlx::Transaction<'c, sqlx::Postgres>, ) -> crate::error::Result { - let s = - sqlx::query_as::<_, Script>("SELECT * FROM script WHERE hash = $1 AND workspace_id = $2") - .bind(base_hash.0) - .bind(w_id) - .fetch_one(&mut **tx) - .await?; + let s = sqlx::query_as::<_, Script>( + "SELECT workspace_id, hash, path, parent_hashes, summary, description, content, \ + created_by, created_at, archived, schema, deleted, is_template, extra_perms, \ + lock, lock_error_logs, language, kind, tag, draft_only, envs, concurrent_limit, \ + concurrency_time_window_s, cache_ttl, dedicated_worker, ws_error_handler_muted, \ + priority, timeout, delete_after_use, restart_unless_cancelled, concurrency_key, \ + visible_to_runner_only, no_main_func, codebase, has_preprocessor, on_behalf_of_email, \ + assets \ + FROM script WHERE hash = $1 AND workspace_id = $2", + ) + .bind(base_hash.0) + .bind(w_id) + .fetch_one(&mut **tx) + .await?; let ns = NewScript { path: s.path.clone(),