windmill icon indicating copy to clipboard operation
windmill copied to clipboard

bug: Can't assign NULL to variables in Postges script

Open betterthanever2 opened this issue 2 years ago • 1 comments

Describe the bug

When creating a PostgreSQL script in Windmill, one can customize query variables in the following way:

-- $1 name1 = default arg
-- $2 name2
INSERT INTO demo VALUES ($1::TEXT, $2::INT) RETURNING *

However, nowhere in the documentation does it say anything about NULL values or non-required fields (the AI also doesn't know). I tried using NULL, null, None, and other variations thereof, but all of them are interpreted as strings. In effect, one can't have a non-required field without a non-NULL default value.

I consider this a bug because it's basic database functionality.

To reproduce

  1. Go to Create a script
  2. Select Postgres
  3. Enter query
  4. Define variables
  5. Assign value "NULL", "null", "None" or something similar to one of a value, with or without quotes.
  6. See that it's interpreted as a string.

Expected behavior

There should be a clear and documented way to assign NULL values to variables

Screenshots

No response

Browser information

No response

Application version

No response

Additional Context

No response

betterthanever2 avatar Nov 10 '23 11:11 betterthanever2

On a related note, assigning False to a boolean variable doesn't work - it shows as True (Enabled) in the UI.

betterthanever2 avatar Nov 10 '23 12:11 betterthanever2